···795795}796796EXPORT_SYMBOL_GPL(qcom_smem_get_soc_id);797797798798+/**799799+ * qcom_smem_get_feature_code() - return the feature code800800+ * @code: On success, return the feature code here.801801+ *802802+ * Look up the feature code identifier from SMEM and return it.803803+ *804804+ * Return: 0 on success, negative errno on failure.805805+ */806806+int qcom_smem_get_feature_code(u32 *code)807807+{808808+ struct socinfo *info;809809+ u32 raw_code;810810+811811+ info = qcom_smem_get(QCOM_SMEM_HOST_ANY, SMEM_HW_SW_BUILD_ID, NULL);812812+ if (IS_ERR(info))813813+ return PTR_ERR(info);814814+815815+ /* This only makes sense for socinfo >= 16 */816816+ if (__le32_to_cpu(info->fmt) < SOCINFO_VERSION(0, 16))817817+ return -EOPNOTSUPP;818818+819819+ raw_code = __le32_to_cpu(info->feature_code);820820+821821+ /* Ensure the value makes sense */822822+ if (raw_code > SOCINFO_FC_INT_MAX)823823+ raw_code = SOCINFO_FC_UNKNOWN;824824+825825+ *code = raw_code;826826+827827+ return 0;828828+}829829+EXPORT_SYMBOL_GPL(qcom_smem_get_feature_code);830830+798831static int qcom_smem_get_sbl_version(struct qcom_smem *smem)799832{800833 struct smem_header *header;
-8
drivers/soc/qcom/socinfo.c
···21212222#include <dt-bindings/arm/qcom,ids.h>23232424-/*2525- * SoC version type with major number in the upper 16 bits and minor2626- * number in the lower 16 bits.2727- */2828-#define SOCINFO_MAJOR(ver) (((ver) >> 16) & 0xffff)2929-#define SOCINFO_MINOR(ver) ((ver) & 0xffff)3030-#define SOCINFO_VERSION(maj, min) ((((maj) & 0xffff) << 16)|((min) & 0xffff))3131-3224/* Helper macros to create soc_id table */3325#define qcom_board_id(id) QCOM_ID_ ## id, __stringify(id)3426#define qcom_board_id_named(id, name) QCOM_ID_ ## id, (name)
+23
include/linux/firmware/qcom/qcom_scm.h
···115115int qcom_scm_lmh_profile_change(u32 profile_id);116116bool qcom_scm_lmh_dcvsh_available(void);117117118118+/*119119+ * Request TZ to program set of access controlled registers necessary120120+ * irrespective of any features121121+ */122122+#define QCOM_SCM_GPU_ALWAYS_EN_REQ BIT(0)123123+/*124124+ * Request TZ to program BCL id to access controlled register when BCL is125125+ * enabled126126+ */127127+#define QCOM_SCM_GPU_BCL_EN_REQ BIT(1)128128+/*129129+ * Request TZ to program set of access controlled register for CLX feature130130+ * when enabled131131+ */132132+#define QCOM_SCM_GPU_CLX_EN_REQ BIT(2)133133+/*134134+ * Request TZ to program tsense ids to access controlled registers for reading135135+ * gpu temperature sensors136136+ */137137+#define QCOM_SCM_GPU_TSENSE_EN_REQ BIT(3)138138+139139+int qcom_scm_gpu_init_regs(u32 gpu_req);140140+118141#ifdef CONFIG_QCOM_QSEECOM119142120143int qcom_scm_qseecom_app_get_id(const char *app_name, u32 *app_id);