I am attempting to build an u-boot for CM5 to disable uart2 in u-boot, are there any guidance on how these ports are managed in the dts?
I’ve built custom U-boot for rk3588 (Rock 5 ITX) and I don’t think it will be easy what you’re asking.
First of all, you don’t need any device tree changes. DTS has (almost) nothing to do with it.
The main problem is that the rk3588 boot starts with a ddr blob. That blob inits uart 2 at predefined 1500000 baud and outputs text on it even before u-boot starts. Theoretically, you should be able to tweak a custom blob using ddrbin_tool from here: rkbin/tools at master · rockchip-linux/rkbin · GitHub , but I didn’t try that (yet). I recommend you erase the SPI and emmc (if it has them) and boot from SD card while you run tests. To me, it’s easier to replace U-boot via a card reader than reflashing via USB.
Disabling uart output in u-boot should be easy. Simply remove the uart driver from TPL, SPL and U-boot proper and enable that option “support null console” or something… I expect there will be some build errors that you will need to solve. U-boot isn’t really tolerant to defconfig changes.
The kernel doesn’t output anything on the uart until the driver loads. There is no earlyprintk on arm64. I’m not sure if the DTS (or possibly U-boot runtime changes to it) sets a kernel console on that uart, but you simply move the console via kernel command line: console=tty0 or whatever you want and that’s all. No changes to DTS necessary.
Last problem is that the userspace (sysvinit, runit, systemd, or whatever you have) might create a virtual terminal on that uart. Make sure it’s disabled.