Pin mode change in runtime(application)

Colibri Evaluation Board V3.2
Colibri iMX6ULL 1GB IT

I would like to use the pin set as UART’s TX as a GPIO(OUTPUT) in application.
For example, I would like to control High/Low with TX pins before UART TX.
GPIO 0_5 to High → delay → GPIO 0_5 to Low → delay → UART TX
Is it possible?

The device tree settings are as follows.
pinctrl_uart5: uart5grp {
fsl,pins = <
MX6UL_PAD_GPIO1_IO04__UART5_DTE_RX 0x1b0b1 /* SODIMM 19 /
MX6UL_PAD_GPIO1_IO05__UART5_DTE_TX 0x1b0b1 /
SODIMM 21 */
>;
};

How long delays are required? Would they fit least UART bitrate time X 10? For 110 bps it could be 90.1ms. If that’s enough, then switch bitrate and send a break.

Simplest hack could be use of devmem2. Figure in RM which registers at what addresses to write and write at runtime.

Right way perhaps could be use of writeable /sys/kernel/debug/pinctrl/xxx/pinmux-select. But according to this’s

Add "pinmux-select" to debugfs which will activate a function and group:

  echo "<function-name group-name>" > pinmux-select

The write operation pinmux_select() handles this by checking that the
names map to valid selectors and then calling ops->set_mux().

The existing "pinmux-functions" debugfs file lists the pin functions
registered for the pin controller. For example:

  function: pinmux-uart0, groups = [ pinmux-uart0-pins ]
  function: pinmux-mmc0, groups = [ pinmux-mmc0-pins ]
  function: pinmux-mmc1, groups = [ pinmux-mmc1-pins ]
  function: pinmux-i2c0, groups = [ pinmux-i2c0-pins ]
  function: pinmux-i2c1, groups = [ pinmux-i2c1-pins ]
  function: pinmux-spi1, groups = [ pinmux-spi1-pins ]

To activate function pinmux-i2c1 and group pinmux-i2c1-pins:

  echo "pinmux-i2c1 pinmux-i2c1-pins" > pinmux-select

pinmux-functions should list those functions. But on iMX6ULL I see single function 0 and a lot of groups, so minimum a lot of DT editing would be required to go this path. Isn’t it?