refactor(context mgmt): refactor the cm_setup_context function

This patch splits the function 'cm_setup_context' into four
functions to make it more readable and easier to maintain.

The function is split into the following functions based on
the security state of the context.

 - setup_context_common - performs common initializations
 - setup_secure_context - performs Secure state specific
 - setup_realm_context - performs Realm state specific
 - setup_ns_context - performs Non-secure state specific

Signed-off-by: Zelalem Aweke <>
Change-Id: Ie14a1c2fc6586087e7aa36537cf9064c80802f8f
1 file changed