There is no sample code for that. The SECMON is a state machine, it change state based on signals from the HW pins/signal.
The state change diagram is in the QORIQTURST21UG, section 7.2 Security Monitor (SecMon) Figure 7-1. Security Monitor Block Diagram
If you want to manually change the state, you can touch the SecMon_HP Command Register (HPCOMR), bit 0, SSM State Transition Transition state of the system security monitor. This self-clearing bit is always read as zero. This command results only in the following transitions of the SSM:
Check State Non-Secure (when Non-Secure Boot and not in Unsecure Configuration )
Check State --> Trusted (when Secure Boot or in Unsecure Configuration ) Trusted State --> Secure Secure State --> Trusted (if not disabled by SSM_ST_DIS bit) Soft Fail --> Non-Secure (if not disabled by SSM_SFNS_DIS bit)
OR
bit 8, Software Security Violation
When set, the system security monitor treats this bit as a non-fatal security violation. This security violation has no effect on the LP section. This command results only in the following transitions of the
SSM:
Check -> Non-Secure
Trusted -> Soft Fail
Secure -> Soft Fail