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

scc_return_t scc_engage_partition ( void *  part_base,
const uint8_t *  UMID,
uint32_t  permissions 
)

Engage partition of secure memory

Parameters:
part_base (kernel) Virtual
UMID NULL, or 16-byte UMID for partition security
permissions ORed values from fsl_shw_permission_t which will be used as initial partiition permissions.
Returns:
SCC_RET_OK if successful.

Definition at line 442 of file scc2_driver.c.

References host_owns_partition(), partition_engaged(), SCC_READ_REGISTER, SCC_RET_FAIL, SCC_RET_OK, SCM_ACC0_REG, SCM_PART_NUMBER, and SCM_SMID0_REG.

Referenced by fsl_shw_smalloc().

{
      uint32_t partition_no;
      uint8_t *UMID_base = part_base + 0x10;
      uint32_t *MAP_base = part_base;
      uint8_t i;

      partition_no = SCM_PART_NUMBER((uint32_t) part_base);

      if (!host_owns_partition(partition_no) ||
          partition_engaged(partition_no) ||
          !(SCC_READ_REGISTER(SCM_SMID0_REG + (partition_no * 8)) == 0)) {

            return SCC_RET_FAIL;
      }

      if (UMID != NULL) {
            for (i = 0; i < 16; i++) {
                  UMID_base[i] = UMID[i];
            }
      }

      MAP_base[0] = permissions;

      udelay(20);

      /* Check that the partition was engaged correctly, and that it has the
       * proper permissions.
       */

      if ((!partition_engaged(partition_no)) ||
          (permissions !=
           SCC_READ_REGISTER(SCM_ACC0_REG + 8 * partition_no))) {
            return SCC_RET_FAIL;
      }

      return SCC_RET_OK;
}


Generated by  Doxygen 1.6.0   Back to index