Hello,
I have tried to move both console and u-boot to uartc(/dev/ttymc2) from uarta(/dev/ttymxc0) to be able to use uarta for another purpose. I have applied below patches to my yocto build, now u-boot messages and kernel messages are shown in uartc, and after booting I see a login promt on uartc.
But I see another login promt on usba. In /etc/systemd/system/getty.target.wants/ directory there are two other getty and there is not ttymxc2.
root@colibri-imx6:~# ls /etc/systemd/system/getty.target.wants/
getty@tty1.service serial-getty@ttymxc0.service
Kernel messages are:
[ OK ] Started Getty on tty1.
[ OK ] Started Serial Getty on ttymxc0.
[ OK ] Started Serial Getty on ttymxc2.
I disabled it with runnig systemctl disable serial-getty@ttymxc0.service
command on colibri and seems its working. But I don’t understand why I needed to run this command and why systemd-getty-generator
generate service at ttymxc0
.
How can I remove getty on ttymxc0 from yocto without running command on colibri?
u-boot patch:
Index: git/board/toradex/colibri_imx6/colibri_imx6.c
===================================================================
--- git.orig/board/toradex/colibri_imx6/colibri_imx6.c
+++ git/board/toradex/colibri_imx6/colibri_imx6.c
@@ -95,10 +95,10 @@ int dram_init(void)
return 0;
}
-/* Colibri UARTA */
-iomux_v3_cfg_t const uart1_pads[] = {
- MX6_PAD_CSI0_DAT10__UART1_RX_DATA | MUX_PAD_CTRL(UART_PAD_CTRL),
- MX6_PAD_CSI0_DAT11__UART1_TX_DATA | MUX_PAD_CTRL(UART_PAD_CTRL),
+/* Colibri UARTC */
+iomux_v3_cfg_t const uart3_pads[] = {
+ MX6_PAD_SD4_CMD__UART3_RX_DATA | MUX_PAD_CTRL(UART_PAD_CTRL),
+ MX6_PAD_SD4_CLK__UART3_TX_DATA | MUX_PAD_CTRL(UART_PAD_CTRL),
};
#define PC MUX_PAD_CTRL(I2C_PAD_CTRL)
@@ -283,7 +283,7 @@ static void setup_dtemode_uart(void)
static void setup_iomux_uart(void)
{
setup_dtemode_uart();
- imx_iomux_v3_setup_multiple_pads(uart1_pads, ARRAY_SIZE(uart1_pads));
+ imx_iomux_v3_setup_multiple_pads(uart3_pads, ARRAY_SIZE(uart3_pads));
}
#ifdef CONFIG_USB_EHCI_MX6
@@ -1210,7 +1210,7 @@ int g_dnl_bind_fixup(struct usb_device_d
#endif
static struct mxc_serial_platdata mxc_serial_plat = {
- .reg = (struct mxc_uart *)UART1_BASE,
+ .reg = (struct mxc_uart *)UART3_BASE,
.use_dte = true,
};
Index: git/include/configs/colibri_imx6.h
===================================================================
--- git.orig/include/configs/colibri_imx6.h
+++ git/include/configs/colibri_imx6.h
@@ -44,7 +44,7 @@
#define CONFIG_MISC_INIT_R
#define CONFIG_MXC_UART
-#define CONFIG_MXC_UART_BASE UART1_BASE
+#define CONFIG_MXC_UART_BASE UART3_BASE
/* Make the HW version stuff available in U-Boot env */
#define CONFIG_ENV_VARS_UBOOT_CONFIG
@@ -136,7 +136,7 @@
/* allow to overwrite serial and ethaddr */
#define CONFIG_ENV_OVERWRITE
-#define CONFIG_CONS_INDEX 1
+#define CONFIG_CONS_INDEX 3
#define CONFIG_BAUDRATE 115200
/* Command definition */
@@ -239,7 +239,7 @@
#define CONFIG_EXTRA_ENV_SETTINGS \
BOOTENV \
"boot_file=zImage\0" \
- "console=ttymxc0\0" \
+ "console=ttymxc2\0" \
"defargs=galcore.contiguousSize=50331648 user_debug=30\0" \
"dfu_alt_info=" DFU_ALT_EMMC_INFO "\0" \
EMMC_BOOTCMD \
@@ -255,7 +255,7 @@
"${interface} ${drive}:1 ${loadaddr} flash_blk.img && " \
"source ${loadaddr}\0" \
"setup=setenv setupargs fec_mac=${ethaddr} " \
- "consoleblank=0 no_console_suspend=1 console=tty1 " \
+ "consoleblank=0 no_console_suspend=1 " \
"console=${console},${baudrate}n8\0" \
"setupdate=run setsdupdate || run setusbupdate || run setethupdate\0" \
"setusbupdate=usb start && setenv interface usb; setenv drive 0; " \
kernel patch:
Index: kernel-source/arch/arm/configs/colibri_imx6_defconfig
===================================================================
--- kernel-source.orig/arch/arm/configs/colibri_imx6_defconfig
+++ kernel-source/arch/arm/configs/colibri_imx6_defconfig
@@ -32,7 +32,7 @@ CONFIG_HIGHMEM=y
CONFIG_CMA=y
CONFIG_UACCESS_WITH_MEMCPY=y
CONFIG_SECCOMP=y
-CONFIG_CMDLINE="noinitrd console=ttymxc0,115200"
+CONFIG_CMDLINE="noinitrd console=ttymxc2,115200"
CONFIG_CPU_FREQ=y
CONFIG_CPU_FREQ_DEFAULT_GOV_INTERACTIVE=y
CONFIG_CPU_FREQ_GOV_POWERSAVE=y