Logo Search packages:      
Sourcecode: linux-fsl-imx51 version File versions  Download package

scc_return_t scc_diminish_permissions ( void *  part_base,
uint32_t  permissions 

Diminish the permissions on a partition of secure memory

part_base Kernel virtual address of the partition.
permissions ORed values of the type SCM_PERM_* which will be used as initial partition permissions. SHW API users should use the FSL_PERM_* definitions instead.
SCC_RET_OK if successful.

Definition at line 351 of file scc2_driver.c.

References SCC_READ_REGISTER, SCC_RET_FAIL, SCC_RET_OK, scc_write_register(), SCM_ACC0_REG, and SCM_PART_NUMBER.

Referenced by fsl_shw_diminish_perms().

      uint32_t partition_no;
      uint32_t permissions_requested;
      permissions_requested = permissions;

      /* ensure that this is a proper partition location */
      partition_no = SCM_PART_NUMBER((uint32_t) part_base);

      /* invert the permissions, masking out unused bits */
      permissions = (~permissions) & SCM_PERM_MASK;

      /* attempt to diminish the permissions */
      scc_write_register(SCM_ACC0_REG + 8 * partition_no, permissions);

      /* Reading it back puts it into the original form */
      permissions = SCC_READ_REGISTER(SCM_ACC0_REG + 8 * partition_no);
      if (permissions == permissions_requested) {
            pr_debug("scc_partition_diminish_perms: successful\n");
            pr_debug("scc_partition_diminish_perms: successful\n");
            return SCC_RET_OK;
      pr_debug("scc_partition_diminish_perms: not successful\n");

      return SCC_RET_FAIL;

Generated by  Doxygen 1.6.0   Back to index