I've read in one of the app notes that I could swap differencial pair polarity (N -> P, P -> N). I assume that this applies only to pairs of Tx and Rx, right? Or D+ and D- could also be swapped?
I think that D+/D- can't be swapped becouse one pair polarity must be known to negotiate another two. Am I right?
Or maybe polarity inversion is not desirable even on Tx/Rx pairs?
You can swap the SSTX and SSRX pairs but not the USB2 (D+/D-) pair. This is because, during SuperSpeed enumeration, certain training sequences (called TSEQs) are sent and the D10.2 symbol in this is used to detect if lane polarity inversion is done (refer to section 6.4.2 of the USB 3.0 spec). However, such lane inversion detection is not done in USB 2.0 enumeration.
This inversion is recommended if your design will cause SSTX+ and SSTX- (or the RX pairs) to cross each other. Then you can swap these pins to avoid this crossing.
See AN70707 for more details.
The polarity is detected automatically during SS Link training, no additional FW effort is required. Spec allows this only on the Superspeed lines, not allowed on Highspeed lines.