/** @file  IDeviceID.idl */

/* Copyright (c) 2015-2018 Qualcomm Technologies, Inc.  All Rights Reserved.
   Qualcomm Technologies Proprietary and Confidential. */

/** @cond */
interface IDeviceID {
/** @endcond */

  /** @cond */
  const uint32 BOOT_ROM_VERSION = 1;
  const uint32 SBL_VERSION      = 2;
  const uint32 QSEE_VERSION     = 3;
  const uint32 HYP_VERSION      = 4;
  /** @endcond */

  /**
   * @addtogroup IDeviceID
   * @{
   */

  /**
    Reads JTAG ID.

    @param[out] jtagId  ID from the JTAG.

    @return
    Object_OK if successful.
  */
  method readJtagID(out uint32 jtagId);

  /**
    Reads serial number from PTE chain.

    @param[out] serialNum  Device serial number.

    @return
    Object_OK if successful.
  */
  method readSerialNum(out uint64 serialNum);

  /**
    Returns a globally-unique ID identifying this device.

    @param[out] uuid  UUID in native byte order.

    @return
    Object_OK if successful.
  */
  method getDeviceUUID(out buffer uuid);

  /**
    Returns a buffer identifying the version of the component
    executing on this device.

    @param[in]  componentId   Component identifier.
    @param[out] versionBuffer Componet version buffer.

    @detdesc
    These buffers are printable ASCII strings, but are not NULL-terminated. The
    maximum buffer size is 128 bytes.

    @return Object_OK if successful.
  */
  method getComponentVersion(in uint32 componentId, out buffer versionBuffer);

  /**
    Returns the 32-bit integer OEM ID from fuses.

    @param[out] oemId OEM ID.

    @return Object_OK if successful.
   */
   method getOEMID(out uint32 oemId);

  /**
    Returns the 32-bit hardware version from the metal layer.

    @param[out] hwVersion Hardware version integer.

    @return Object_OK if successful.
   */
   method getHWVersion(out uint32 hwVersion);

  /**
    Returns the 32-byte hash of the public key used to verify the boot image.

    @param[out] pkHash Public key hash.

    @return Object_OK if successful.
  */
  method getPKHash(out buffer pkHash);

  /**
    Returns device information from CM hardware.

    @param[out] deviceId Device Unique ID from CM hardware.

    @return Object_OK if successful.
   */
  method getDeviceIdFromCM(out buffer deviceId);

  /**
    Returns a digest of a salted SHA256 hash of the CHIP_ID concatenated with
    the SERIAL_NUM.

    This function provides the Client with the ability to create a Client
    specific unique device ID.

    @param[in]  clientSalt  Buffer from the Client containing the hash salt.
    @param[out] deviceId    Client specific digest. The buffer needs to be at
                            least 32 bytes in size in order to contain the
                            digest.
    
    @return Object_OK if successful.
  */
  method getClientDeviceID(in buffer clientSalt, out buffer deviceId);

 /**
    Returns the 32-bit integer Product ID from fuses.

    @param[out] productId Product ID.

    @return Object_OK if successful.
   */
   method getProductID(out uint32 productId);

  /** @} */ /* end_addtogroup IDeviceID */
};



