# DCSM Module

The DCSM driver accesses the DCSM COMMON registers. In order to configure the Dual Code Security Module, the user must program the Linkpointer in DCSM OTP as well as the security configuration registers of the Zone Select Blocks in DCSM OTP. The DCSM driver provides functions which secure and unsecure each zone and return the ownership, security status, EXEONLY status of specific RAM modules or Flash sectors. Included are two functions which can claim and release the Flash pump to operate on a specific zone.

group `dcsm_api`

  Defines

  `DCSM_O_Z1_CSMPSWD0` 0x00U

    Z1 CSMPSWD0 offset.

  `DCSM_O_Z1_CSMPSWD1` 0x02U

    Z1 CSMPSWD1 offset.

  `DCSM_O_Z1_CSMPSWD2` 0x04U

    Z1 CSMPSWD2 offset.

  `DCSM_O_Z1_CSMPSWD3` 0x06U

    Z1 CSMPSWD3 offset.

  `DCSM_O_Z2_CSMPSWD0` 0x00U

    Z2 CSMPSWD0 offset.

  `DCSM_O_Z2_CSMPSWD1` 0x02U

    Z2 CSMPSWD1 offset.

  `DCSM_O_Z2_CSMPSWD2` 0x04U

    Z2 CSMPSWD2 offset.

  `DCSM_O_Z2_CSMPSWD3` 0x06U

    Z2 CSMPSWD3 offset.

  `FLSEM_KEY` 0xA5U

    Zone semaphore key.

  `DCSM_FORCE_SECERR_KEY` 0x5A5AU
  `DCSM_ALLZERO` 0x08U

    CSM Passwords all zeros.

  `DCSM_ALLONE` 0x10U

    CSM Passwords all ones.

  `DCSM_UNSECURE` 0x20U

    Zone is secure/unsecure.

  `DCSM_ARMED` 0x40U

    CSM is armed.

  `DCSM_EXEONLYSECTR_M` 0x0000FFFFU
  `DCSM_EXEONLYSECTR_S` 16U
  `DCSM_ZX_CR_S` 16U
  `DCSM_Z1_EXEONLYRAM1R_CPU2` 31U
  `DCSM_Z2_EXEONLYRAM1R_CPU2` 31U
  `DCSM_Z1_OTPSECLOCK_JTAGLOCK_M` 0x1U
  `DCSM_Z1_OTPSECLOCK_JTAGLOCK_S` 0U
  `DCSM_OTPSECLOCK_INVALID` 0xFFFFU

  Enums

  enum `DCSM_MemoryStatus`

    Values to distinguish the status of RAM or FLASH sectors. These values describe which zone the memory location belongs too. These values can be returned from DCSM_getRAMZone(), DCSM_getFlashSectorZone().

    Values:

    enumerator `DCSM_MEMORY_INACCESSIBLE`

      Inaccessible.

    enumerator `DCSM_MEMORY_ZONE1`

      Zone 1.

    enumerator `DCSM_MEMORY_ZONE2`

      Zone 2.

    enumerator `DCSM_MEMORY_FULL_ACCESS`

      Full access.

  enum `DCSM_SemaphoreZone`

    Values to pass to DCSM_claimZoneSemaphore(). These values are used to describe the zone that can write to Flash Wrapper registers.

    Values:

    enumerator `DCSM_FLSEM_ZONE1` = 0x01U

      Flash semaphore Zone 1.

    enumerator `DCSM_FLSEM_ZONE2` = 0x02U

      Flash semaphore Zone 2.

  enum `DCSM_SecurityStatus`

    Values to distinguish the security status of the zones. These values can be returned from DCSM_getZone1CSMSecurityStatus(), DCSM_getZone2CSMSecurityStatus().

    Values:

    enumerator `DCSM_STATUS_SECURE`

      Secure.

    enumerator `DCSM_STATUS_UNSECURE`

      Unsecure.

    enumerator `DCSM_STATUS_LOCKED`

      Locked.

    enumerator `DCSM_STATUS_BLOCKED`

      Blocked.

  enum `DCSM_EXEOnlyStatus`

    Values to decribe the EXEONLY Status. These values are returned from to DCSM_getZone1RAMEXEStatus(), DCSM_getZone2RAMEXEStatus(), DCSM_getZone1FlashEXEStatus(), DCSM_getZone2FlashEXEStatus().

    Values:

    enumerator `DCSM_PROTECTED`

      Protected.

    enumerator `DCSM_UNPROTECTED`

      Unprotected.

    enumerator `DCSM_INCORRECT_ZONE`

      Incorrect Zone.

  enum `DCSM_RAMModule`

    Values to distinguish RAM Module. These values can be passed to DCSM_getZone1RAMEXEStatus() DCSM_getZone2RAMEXEStatus(), DCSM_getRAMZone().

    Values:

    enumerator `DCSM_RAMLS0`

      RAMLS0.

    enumerator `DCSM_RAMLS1`

      RAMLS1.

    enumerator `DCSM_RAMLS2`

      RAMLS2.

    enumerator `DCSM_RAMLS3`

      RAMLS3.

    enumerator `DCSM_RAMLS4`

      RAMLS4.

    enumerator `DCSM_RAMLS5`

      RAMLS5.

    enumerator `DCSM_RAMLS6`

      RAMLS6.

    enumerator `DCSM_RAMLS7`

      RAMLS7.

    enumerator `DCSM_RAMLS8`

      RAMLS8.

    enumerator `DCSM_RAMLS9`

      RAMLS9.

    enumerator `DCSM_RAMD0`

      RAMD0.

    enumerator `DCSM_RAMD1`

      RAMD1.

    enumerator `DCSM_RAMD2`

      RAMD2.

    enumerator `DCSM_RAMD3`

      RAMD3.

    enumerator `DCSM_RAMD4`

      RAMD4.

    enumerator `DCSM_RAMD5`

      RAMD5.

    enumerator `DCSM_C28_RAM_END`
    enumerator `DCSM_RAM1_CPU1_CPU2`

      CPU1 to CPU2 Message RAM 1.

    enumerator `DCSM_RAM2_CPU1_CPU2`

      CPU1 to CPU2 Message RAM 2.

    enumerator `DCSM_RAM1_CPU2_CPU1`

      CPU2 to CPU1 Message RAM 1.

    enumerator `DCSM_RAM2_CPU2_CPU1`

      CPU2 to CPU1 Message RAM 2.

  enum `DCSM_Sector`

    Values to distinguish Flash Sector. These values can be passed to DCSM_getZone1FlashEXEStatus() DCSM_getZone2FlashEXEStatus(), DCSM_getFlashSectorZone().

    Values:

    enumerator `DCSM_BANK0_SECTOR_0`

      Bank 0 - Sector 0.

    enumerator `DCSM_BANK0_SECTOR_1`

      Bank 0 - Sector 1.

    enumerator `DCSM_BANK0_SECTOR_2`

      Bank 0 - Sector 2.

    enumerator `DCSM_BANK0_SECTOR_3`

      Bank 0 - Sector 3.

    enumerator `DCSM_BANK0_SECTOR_31_4`

      Bank 0 - Sector 31-4.

    enumerator `DCSM_BANK0_SECTOR_63_32`

      Bank 0 - Sector 63-32.

    enumerator `DCSM_BANK0_SECTOR_95_64`

      Bank 0 - Sector 95-64.

    enumerator `DCSM_BANK0_SECTOR_127_96`

      Bank 0 - Sector 127-96.

    enumerator `DCSM_BANK1_SECTOR_0`

      Bank 1 - Sector 0.

    enumerator `DCSM_BANK1_SECTOR_1`

      Bank 1 - Sector 1.

    enumerator `DCSM_BANK1_SECTOR_2`

      Bank 1 - Sector 2.

    enumerator `DCSM_BANK1_SECTOR_3`

      Bank 1 - Sector 3.

    enumerator `DCSM_BANK1_SECTOR_31_4`

      Bank 1 - Sector 31-4.

    enumerator `DCSM_BANK1_SECTOR_63_32`

      Bank 1 - Sector 63-32.

    enumerator `DCSM_BANK1_SECTOR_95_64`

      Bank 1 - Sector 95-64.

    enumerator `DCSM_BANK1_SECTOR_127_96`

      Bank 1 - Sector 127-96.

    enumerator `DCSM_BANK2_SECTOR_0`

      Bank 2 - Sector 0.

    enumerator `DCSM_BANK2_SECTOR_1`

      Bank 2 - Sector 1.

    enumerator `DCSM_BANK2_SECTOR_2`

      Bank 2 - Sector 2.

    enumerator `DCSM_BANK2_SECTOR_3`

      Bank 2 - Sector 3.

    enumerator `DCSM_BANK2_SECTOR_31_4`

      Bank 2 - Sector 31-4.

    enumerator `DCSM_BANK2_SECTOR_63_32`

      Bank 2 - Sector 63-32.

    enumerator `DCSM_BANK2_SECTOR_95_64`

      Bank 2 - Sector 95-64.

    enumerator `DCSM_BANK2_SECTOR_127_96`

      Bank 2 - Sector 127-96.

    enumerator `DCSM_BANK3_SECTOR_0`

      Bank 3 - Sector 0.

    enumerator `DCSM_BANK3_SECTOR_1`

      Bank 3 - Sector 1.

    enumerator `DCSM_BANK3_SECTOR_2`

      Bank 3 - Sector 2.

    enumerator `DCSM_BANK3_SECTOR_3`

      Bank 3 - Sector 3.

    enumerator `DCSM_BANK3_SECTOR_31_4`

      Bank 3 - Sector 31-4.

    enumerator `DCSM_BANK3_SECTOR_63_32`

      Bank 3 - Sector 63-32.

    enumerator `DCSM_BANK3_SECTOR_95_64`

      Bank 3 - Sector 95-64.

    enumerator `DCSM_BANK3_SECTOR_127_96`

      Bank 3 - Sector 127-96.

    enumerator `DCSM_BANK4_SECTOR_0`

      Bank 4 - Sector 0.

    enumerator `DCSM_BANK4_SECTOR_1`

      Bank 4 - Sector 1.

    enumerator `DCSM_BANK4_SECTOR_2`

      Bank 4 - Sector 2.

    enumerator `DCSM_BANK4_SECTOR_3`

      Bank 4 - Sector 3.

    enumerator `DCSM_BANK4_SECTOR_31_4`

      Bank 4 - Sector 31-4.

    enumerator `DCSM_BANK4_SECTOR_63_32`

      Bank 4 - Sector 63-32.

    enumerator `DCSM_BANK4_SECTOR_95_64`

      Bank 4 - Sector 95-64.

    enumerator `DCSM_BANK4_SECTOR_127_96`

      Bank 4 - Sector 127-96.

  enum `DCSM_CPUSel`

    The following are values that can be passed to DCSM_getRAMZone(), DCSM_getZone2FlashEXEStatus() ,DCSM_getZone1FlashEXEStatus() & DCSM_getFlashSectorZone() as cpuInst parameter.

    Values:

    enumerator `DCSM_CPUSEL_CPU1` = 0x0U

      To access CPU1 Memory.

    enumerator `DCSM_CPUSEL_CPU2` = 0x2U

      To access CPU2 Memory.

  enum `DCSM_OTPLock`

    The following are values that can be passed to DCSM_getZone1OTPSecureLockStatus() & DCSM_getZone2OTPSecureLockStatus() as lockType parameter.

    Values:

    enumerator `DCSM_OTPSECLOCK_JTAG` = 0x0U

      JTAG Lock Status.

    enumerator `DCSM_OTPSECLOCK_PSWDLOCK` = 0x1U

      Zone Password Lock.

    enumerator `DCSM_OTPSECLOCK_CRCLOCK` = 0x2U

      Zone CRC Lock.

  enum `DCSM_PERSem`

    The following are values that can be passed to DCSM_forcePerSemStatus() & DCSM_getPerSemStatus() as grabType parameter.

    Values:

    enumerator `DCSM_GRABWD` = 0U

      Grab Watchdog configuration.

    enumerator `DCSM_GRABNMIWD` = 2U

      Grab NMIWD configuration.

    enumerator `DCSM_GRABTIMER1` = 4U

      Grab TIMER1 configuration.

    enumerator `DCSM_GRABCLKCTL` = 6U

      Grab Clock configuration.

    enumerator `DCSM_GRABRSTCTL` = 8U

      Grab Reset configuration.

  Functions

  void `DCSM_secureZone1`(void)

    Secures zone 1 by setting the FORCESEC bit of Z1_CR register

    This function resets the state of the zone. If the zone is unlocked, it will lock(secure) the zone and also reset all the bits in the Control Register.

    Return

      None.

  void `DCSM_secureZone2`(void)

    Secures zone 2 by setting the FORCESEC bit of Z2_CR register

    This function resets the state of the zone. If the zone is unlocked, it will lock(secure) the zone and also reset all the bits in the Control Register.

    Return

      None.

  DCSM_SecurityStatus `DCSM_getZone1CSMSecurityStatus`(void)

    Returns the CSM security status of zone 1

    This function returns the security status of zone 1 CSM

    Return

      Returns security status as an enumerated type DCSM_SecurityStatus.

  DCSM_SecurityStatus `DCSM_getZone2CSMSecurityStatus`(void)

    Returns the CSM security status of zone 2

    This function returns the security status of zone 2 CSM

    Return

      Returns security status as an enumerated type DCSM_SecurityStatus.

  uint16_t `DCSM_getZone1ControlStatus`(void)

    Returns the Control Status of zone 1

    This function returns the Control Status of zone 1 CSM

    Return

      Returns the contents of the Control Register which can be used with provided defines.

  uint16_t `DCSM_getZone2ControlStatus`(void)

    Returns the Control Status of zone 2

    This function returns the Control Status of zone 2 CSM

    Return

      Returns the contents of the Control Register which can be used with the provided defines.

  DCSM_MemoryStatus `DCSM_getRAMZone`(DCSM_RAMModule module)

    Returns the security zone a RAM section belongs to

    This function returns the security zone a RAM section belongs to.

    Note

      DCSM_CPUSEL_CPU1 can only be used with C28x RAMs (in DCSM_RAMModule)

    Parameters

      - `module`: is the RAM module value. Valid values are type DCSM_RAMModule C28x RAMs :

        - DCSM_RAMLS0

        - DCSM_RAMLS1

        - DCSM_RAMLS2

        - DCSM_RAMLS3

        - DCSM_RAMLS4

        - DCSM_RAMLS5

        - DCSM_RAMLS6

        - DCSM_RAMLS7

        - DCSM_RAMLS8

        - DCSM_RAMLS9

        - DCSM_RAMD0

        - DCSM_RAMD1

        - DCSM_RAMD2

        - DCSM_RAMD3

        - DCSM_RAMD4

        - DCSM_RAMD5

        - DCSM_RAM1_CPU1_CPU2

        - DCSM_RAM2_CPU1_CPU2

        - DCSM_RAM1_CPU2_CPU1

        - DCSM_RAM2_CPU2_CPU1

    Return

      Returns DCSM_MEMORY_INACCESSIBLE if the section is inaccessible, DCSM_MEMORY_ZONE1 if the section belongs to zone 1, DCSM_MEMORY_ZONE2 if the section belongs to zone 2 and DCSM_MEMORY_FULL_ACCESS if the section doesn’t belong to any zone (or if the section is unsecure).

  DCSM_MemoryStatus `DCSM_getFlashSectorZone`(DCSM_Sector sector)

    Returns the security zone a flash sector belongs to

    This function returns the security zone a flash sector belongs to.

    Parameters

      - `sector`: is the flash sector value. Use DCSM_Sector type.

    Return

      Returns DCSM_MEMORY_INACCESSIBLE if the section is inaccessible , DCSM_MEMORY_ZONE1 if the section belongs to zone 1, DCSM_MEMORY_ZONE2 if the section belongs to zone 2 and DCSM_MEMORY_FULL_ACCESS if the section doesn’t belong to any zone (or if the section is unsecure)..

  uint32_t `DCSM_getZone1LinkPointerError`(void)

    Read Zone 1 Link Pointer Error

    A non-zero value indicates an error on the bit position that is set to 1.

    Return

      Returns the value of the Zone 1 Link Pointer error.

  uint32_t `DCSM_getZone2LinkPointerError`(void)

    Read Zone 2 Link Pointer Error

    A non-zero value indicates an error on the bit position that is set to 1.

    Return

      Returns the value of the Zone 2 Link Pointer error.

  bool `DCSM_getFlashErrorStatus`(void)

    Get the status of the security configuration load from USER-OTP or sector error status

    Return

      Returns 0 if no error in loading security information from USER-OTP, 1 if an error has occurred in the load from USER-OTP.

  void `DCSM_clearFlashErrorStatus`(void)

    Clear the Flash Error Status bit

    Write a ‘1’ to the clear bit to clear the sector error status bit.

    Return

      None.

  void `DCSM_forceFlashErrorStatus`(void)

    Set the force Flash Error Status bit

    Write a ‘1’ to force bit to set the sector error status bit.

    Return

      None.

  uint32_t `DCSM_getZone1OTPSecureLockStatus`(DCSM_OTPLock lockType)

    Returns the OTP secure Lock status of zone 1

    The

    lockType parameter can have one of the following values of the DCSM_CPUSel type:

    - DCSM_OTPSECLOCK_JTAG - JTAG Lock Status

    - DCSM_OTPSECLOCK_CRCLOCK - Zone CRC Lock

    - DCSM_OTPSECLOCK_PSWDLOCK - Zone Password Lock

    Parameters

      - `lockType`: is the OTP secure Lock feature type .

    This function takes in a valid OTP secure Lock feature type and returns the status of zone 1 lock feature

    For Zone Password Lock : 1111 - CSM Pwd locations in the OTP are not protected and can be read from the debugger as well as code running from anywhere. Other Value : CSM Pwd locations in the OTP are protected and can’t be read without unlocking CSM of that zone.

    Return

      Returns security lock status can be: For JTAG lock : 0 - JTAG is not locked , 1 - JTAG is locked

    For Zone CRC Lock : 1111 : VCU has ability to calculate CRC on secure memories. Other Value : VCU doesn’t have the ability to calculate CRC on secure memories.

  uint32_t `DCSM_getZone2OTPSecureLockStatus`(DCSM_OTPLock lockType)

    Returns the OTP secure Lock status of zone 2

    The

    lockType parameter can have one of the following values of the DCSM_CPUSel type:

    - DCSM_OTPSECLOCK_CRCLOCK - Zone CRC Lock

    - DCSM_OTPSECLOCK_PSWDLOCK - Zone Password Lock

    Parameters

      - `lockType`: is the OTP secure Lock feature type .

    This function takes in a valid OTP secure Lock feature type and returns the status of zone 2 lock feature

    For Zone Password Lock : 1111 - CSM Pwd locations in the OTP are not protected and can be read from the debugger as well as code running from anywhere. Other Value : CSM Pwd locations in the OTP are protected and can’t be read without unlocking CSM of that zone.

    Return

      Returns security lock status can be:

    For Zone CRC Lock : 1111 : VCU has ability to calculate CRC on secure memories. Other Value : VCU doesn’t have the ability to calculate CRC on secure memories.

  uint16_t `DCSM_getFlashDenyCodeStatus`(void)

    Returns the status of Deny Code register

    This function returns the status of Deny Code register

    Return

      Returns the Status of Deny Code register which can be used with the provided defines.

  uint32_t `DCSM_getDeviceUIDLow`(void)

    Get the device UID_UNIQUE value bits 31 to 0

    This function returns the device UID_UNIQUE value bits 31 to 0.

    Return

      Returns the device UID_UNIQUE value low.

  uint32_t `DCSM_getDeviceUIDHigh`(void)

    Get the device UID_UNIQUE value bits 63 to 32

    This function returns the device UID_UNIQUE value bits 63 to 32.

    Return

      Returns the device UID_UNIQUE value high.

  uint32_t `DCSM_getDevicePartID`(void)

    Get the device PARTIDH value

    This function returns the device PARTIDH value

    Return

      Returns the device PARTIDH value

  uint32_t `DCSM_getPerSemStatus`(DCSM_PERSem grabType)

    Get the Flash wrapper semaphore register value

    This function returns the Flash wrapper register value

    Return

      Returns the Flash wrapper semaphore register value

  void `DCSM_forcePerSemStatus`(DCSM_PERSem grabType, uint16_t value)

    Force the Flash wrapper semaphore register value

    This function writes into the Flash wrapper register field

    Return

      None.

  void `DCSM_unlockZone1CSM`(const DCSM_CSMPasswordKey *const psCMDKey)

    Unlocks Zone 1 CSM.

    This function unlocks the CSM password. It first reads the four password locations in the User OTP. If any of the password values is different from 0xFFFFFFFF, it unlocks the device by writing the provided passwords into CSM Key registers

    Parameters

      - `psCMDKey`: is a pointer to the DCSM_CSMPasswordKey struct that has the CSM password for zone 1.

    Return

      None.

    Note

      This function should not be called in an actual application, should only be used for once to program the OTP memory. Ensure flash data cache is disabled before calling this function(Flash_disableCache).

  void `DCSM_unlockZone2CSM`(const DCSM_CSMPasswordKey *const psCMDKey)

    Unlocks Zone 2 CSM.

    This function unlocks the CSM password. It first reads the four password locations in the User OTP. If any of the password values is different from 0xFFFFFFFF, it unlocks the device by writing the provided passwords into CSM Key registers

    Parameters

      - `psCMDKey`: is a pointer to the CSMPSWDKEY that has the CSM password for zone 2.

    Return

      None.

    Note

      This function should not be called in an actual application, should only be used for once to program the OTP memory. Ensure flash data cache is disabled before calling this function(Flash_disableCache).

  void `DCSM_writeZone1CSM`(const DCSM_CSMPasswordKey *const psCMDKey)

    Write Zone 1 CSM.

    Password match flow is essentially a sequence of dummy reads from password locations (PWL) followed by writes to CSMKEY registers. This function helps writing the provided passwords into the CSM Key registers. The

    DCSM_readZone1CSMPwd() should be called by CPU1 before calling this API.
    Parameters

      - `psCMDKey`: is a pointer to the CSMPSWDKEY that has the CSM password for zone 1.

    Return

      None.

  void `DCSM_writeZone2CSM`(const DCSM_CSMPasswordKey *const psCMDKey)

    Write Zone 2 CSM.

    Password match flow is essentially a sequence of dummy reads from password locations (PWL) followed by writes to CSMKEY registers. This function helps writing the provided passwords into the CSM Key registers. The

    DCSM_readZone2CSMPwd() should be called by CPU1 before calling this API.
    Parameters

      - `psCMDKey`: is a pointer to the CSMPSWDKEY that has the CSM password for zone 2.

    Return

      None.

  DCSM_EXEOnlyStatus `DCSM_getZone1FlashEXEStatus`(DCSM_Sector sector)

    Returns the EXE-ONLY status of zone 1 for a flash sector

    This function takes in a valid sector value and returns the status of EXE ONLY security protection for the sector.

    Parameters

      - `sector`: is the flash sector value. Use DCSM_Sector type.

    Return

      Returns DCSM_PROTECTED if the sector is EXE-ONLY protected, DCSM_UNPROTECTED if the sector is not EXE-ONLY protected, DCSM_INCORRECT_ZONE if sector does not belong to this zone.

  DCSM_EXEOnlyStatus `DCSM_getZone1RAMEXEStatus`(DCSM_RAMModule module)

    Returns the EXE-ONLY status of zone 1 for a RAM module

    This function takes in a valid module value and returns the status of EXE ONLY security protection for that module.

    Parameters

      - `module`: is the RAM module value. Valid values are type DCSM_RAMModule C28x RAMs :

        - DCSM_RAMLS0

        - DCSM_RAMLS1

        - DCSM_RAMLS2

        - DCSM_RAMLS3

        - DCSM_RAMLS4

        - DCSM_RAMLS5

        - DCSM_RAMLS6

        - DCSM_RAMLS7

        - DCSM_RAMLS8

        - DCSM_RAMLS9

        - DCSM_RAMD0

        - DCSM_RAMD1

        - DCSM_RAMD2

        - DCSM_RAMD3

        - DCSM_RAMD4

        - DCSM_RAMD5

        - DCSM_RAM1_CPU1_CPU2

        - DCSM_RAM2_CPU1_CPU2

        - DCSM_RAM1_CPU2_CPU1

        - DCSM_RAM2_CPU2_CPU1

    Return

      Returns DCSM_PROTECTED if the module is EXE-ONLY protected, DCSM_UNPROTECTED if the module is not EXE-ONLY protected, DCSM_INCORRECT_ZONE if module does not belong to this zone.

  DCSM_EXEOnlyStatus `DCSM_getZone2FlashEXEStatus`(DCSM_Sector sector)

    Returns the EXE-ONLY status of zone 2 for a flash sector

    This function takes in a valid sector value and returns the status of EXE ONLY security protection for the sector.

    Parameters

      - `sector`: is the flash sector value. Use DCSM_Sector type.

    Return

      Returns DCSM_PROTECTED if the sector is EXE-ONLY protected, DCSM_UNPROTECTED if the sector is not EXE-ONLY protected, DCSM_INCORRECT_ZONE if sector does not belong to this zone.

  DCSM_EXEOnlyStatus `DCSM_getZone2RAMEXEStatus`(DCSM_RAMModule module)

    Returns the EXE-ONLY status of zone 2 for a RAM module

    This function takes in a valid module value and returns the status of EXE ONLY security protection for that module.

    Parameters

      - `module`: is the RAM module value. Valid values are type DCSM_RAMModule C28x RAMs :

        - DCSM_RAMLS0

        - DCSM_RAMLS1

        - DCSM_RAMLS2

        - DCSM_RAMLS3

        - DCSM_RAMLS4

        - DCSM_RAMLS5

        - DCSM_RAMLS6

        - DCSM_RAMLS7

        - DCSM_RAMLS8

        - DCSM_RAMLS9

        - DCSM_RAMD0

        - DCSM_RAMD1

        - DCSM_RAMD2

        - DCSM_RAMD3

        - DCSM_RAMD4

        - DCSM_RAMD5

        - DCSM_RAM1_CPU1_CPU2

        - DCSM_RAM2_CPU1_CPU2

        - DCSM_RAM1_CPU2_CPU1

        - DCSM_RAM2_CPU2_CPU1

    Return

      Returns DCSM_PROTECTED if the module is EXE-ONLY protected, DCSM_UNPROTECTED if the module is not EXE-ONLY protected, DCSM_INCORRECT_ZONE if module does not belong to this zone.

  bool `DCSM_claimZoneSemaphore`(DCSM_SemaphoreZone zone)

    Claims the zone semaphore which allows access to the Flash Wrapper register for that zone.

    Return

      Returns true for a successful semaphore capture, false if it was unable to capture the semaphore.

    Parameters

      - `zone`: is the zone which is trying to claim the semaphore which allows access to the Flash Wrapper registers.

  bool `DCSM_releaseZoneSemaphore`(void)

    Releases the zone semaphore.

    Return

      Returns true if it was successful in releasing the zone semaphore and false if it was unsuccessful in releasing the zone semaphore.

    Note

      If the calling function is not in the right zone to be able to access this register, it will return a false.

  void `DCSM_readZone1CSMPwd`(void)

    Perform dummy reads on the 128-bit Zone 1 CSM password.

    This function reads the four password locations in the User OTP needed to be done as part of the Password Match Flow before writes to the CSMKEY registers. This would need to be done before a DCSM_writeZone1CSM().

    Return

      None.

    Note

      This API to be called from CPU1.

  void `DCSM_readZone2CSMPwd`(void)

    Perform dummy reads on the 128-bit Zone 2 CSM password.

    This function reads the four password locations in the User OTP needed to be done as part of the Password Match Flow before writes to the CSMKEY registers. This would need to be done before a DCSM_writeZone2CSM().

    Return

      None.

    Note

      This API to be called from CPU1.

  struct `DCSM_CSMPasswordKey`
    #include <dcsm.h>

    Data structures to hold password keys.

The code for this module is contained in driverlib/dcsm.c, with driverlib/dcsm.h containing the API declarations for use by applications.