Hardware-level detection of USB3.0 vs USB2.0
Normally, the port capability is determined by device after connecting and configuring the USB interface. And then control the charger accordingly. But if the device you design does not have any USB, just a charger with a USB3 cable, you can use Rx-detect capability of the USB3 Tx channel, see section 6-11 of USB3.0 specifications.

Essentially you need to provide 45-Ohm termination on Tx -> Rx wires. The host will apply a pulse to Tx-/Tx+ wires, and watch for RC response time. This pulse might be difficult to detect however on Rx side. If the host detects the termination, it will start sending LFPS differential signals, Polling.LFPS, which are bursts at 10-50MHz and 1us in duration, repeated every 10us until timeout of 360ms, since your device will not respond. You should be able to detect this activity. Or maybe just any differential activity on Tx lines will give you a hint if the host port is USB3 or USB2.

Actually, you may want just to detect the Rx-detect activity without providing the termination, just a high-impedance single-ended receiver will do, since the host must periodically check for presence of Rx termination.