Port security can be enabled on access ports or trunk ports, but they must be statically configured as access or trunk.
switchport mode access -> OK
switchport mode trunk -> OK
switchport mode dynamic auto
switchport mode dynamic desirable
Re-enabling an interface (manually)
Re-enabling an interface (ErrDisable Recovery)
Every 5 minutes (by default), all err-disabled interfaces will be re-enabled if err-disable recovery has been enabled for the cause of the interface's disablement.
ErrDisable Recovery is useless if you don't remove the device that caused the interface to enter the err-disabled state!