SPM: Correct 'invalid parameter' error handling

- 'Invalid parameter' is regarded as 'programmer error' instead of
  return 'PSA_ERROR_INVALID_ARGUMENT'.
- 'Programmer error' should be handled inside SPM instead of interface,
  as SPM needs to decide the error handling based on the caller
  attribute.
- Keep the parameters range check inside the interface to give an explicit
  hint.
- Correct 'type' casting to avoid lose sign bit.

Change-Id: I35a5b70b5dc1ea7072c45f0ebac0630f65edfa00
Signed-off-by: Shawn Shan <Shawn.Shan@arm.com>
4 files changed