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

static uint32_t scc_grab_config_values ( void   )  [static]

grab_config_values() will read the SCM Configuration and SMN Status registers and store away version and size information for later use.

Returns:
The current value of the SMN Status register.

Definition at line 1179 of file scc2_driver.c.

References scc_config_t::block_size_bytes, scc_config_t::partition_count, scc_config_t::partition_size_bytes, scc_availability, SCC_READ_REGISTER, SCC_STATUS_CHECKING, SCC_STATUS_UNIMPLEMENTED, scc_update_state(), SCM_VER_BPP_MASK, SCM_VER_BPP_SHIFT, SCM_VER_MAJ_MASK, SCM_VER_MAJ_SHIFT, SCM_VER_NP_MASK, SCM_VER_NP_SHIFT, scc_config_t::scm_version, SCM_VERSION_REG, SMN_STATE_FAIL, SMN_STATUS_VERSION_ID_MASK, SMN_STATUS_VERSION_ID_SHIFT, and scc_config_t::smn_version.

{
      uint32_t scm_version_register;
      uint32_t smn_status_register = SMN_STATE_FAIL;

      if (scc_availability != SCC_STATUS_CHECKING) {
            goto out;
      }
      scm_version_register = SCC_READ_REGISTER(SCM_VERSION_REG);
      pr_debug("SCC2 Driver: SCM version is 0x%08x\n", scm_version_register);

      /* Get SMN status and update scc_availability */
      smn_status_register = scc_update_state();
      pr_debug("SCC2 Driver: SMN status is 0x%08x\n", smn_status_register);

      /* save sizes and versions information for later use */
      scc_configuration.block_size_bytes = 16;  /* BPCP ? */
      scc_configuration.partition_count =
          1 + ((scm_version_register & SCM_VER_NP_MASK) >> SCM_VER_NP_SHIFT);
      scc_configuration.partition_size_bytes =
          1 << ((scm_version_register & SCM_VER_BPP_MASK) >>
              SCM_VER_BPP_SHIFT);
      scc_configuration.scm_version =
          (scm_version_register & SCM_VER_MAJ_MASK) >> SCM_VER_MAJ_SHIFT;
      scc_configuration.smn_version =
          (smn_status_register & SMN_STATUS_VERSION_ID_MASK)
          >> SMN_STATUS_VERSION_ID_SHIFT;
      if (scc_configuration.scm_version != SCM_MAJOR_VERSION_2) {
            scc_availability = SCC_STATUS_UNIMPLEMENTED;    /* Unknown version */
      }

      out:
      return smn_status_register;
}                       /* grab_config_values */


Generated by  Doxygen 1.6.0   Back to index