To use an additional UART interface in u-boot, one can copy the functions from /drivers/serial/serial_mxc.c.
The thing I missed was the
imx_iomux_v3_setup_multiple_pads(uart2_pads, ARRAY_SIZE(uart2_pads));
pin initialization in the board.c, but this only works in board_init or board_late_init, and not in board_early_init_f,
After that, the send and receive functions work properly.