how to close HDMI PORT and uart console

i want to close HDMI port and uart console for secert in tx2,but i do not know the command,
anyone can help me,tks

Actual commands to update a device tree depend on release, and U-Boot itself will differ some among releases, but for the serial console part of your question you might be interested in the topics where people move a serial console to a different port (but instead of enabling the new port you would simply stop after disabling…do be sure to check proper procedure for changing U-Boot and device tree for your specific release):

Please note that serial console within U-Boot is entirely independent and separate to serial console once Linux is running. Both need to be altered.

I have no idea on the HDMI part.

You could also disable HDMI port through device tree. Just try to disable nvdisplay@152xxxxx.