From b62f1fad43d515d0d15a10a4ea335a8862e2ab61 Mon Sep 17 00:00:00 2001 From: Deyan Wang Date: Mon, 4 Sep 2023 09:00:33 +0530 Subject: [PATCH] soc: qcom: hab: add one physical channel group for GPCE add one physical channel group for GPCE, after add it, we have: * 30(29 + 1) hab devices defined in the array hab_devices * 26(26 + 0) pchan_factory_settings entries * 26 vdev-shmem devices defined in most of linux gvm config files for hab We have 1((26 - (30 - 2 - 3) = 1)) vdev-shmem free now. This is because CLK has 2 devices,XVM has 3 devices, and they are not used. Change-Id: Ibf55543bc42101db72215041c12a1a029063c787 Signed-off-by: Deyan Wang --- drivers/soc/qcom/hab/hab.c | 4 ++++ drivers/soc/qcom/hab/hab.h | 1 + include/uapi/linux/habmmid.h | 6 +++++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/soc/qcom/hab/hab.c b/drivers/soc/qcom/hab/hab.c index d812c0801f08..3cda0b578749 100644 --- a/drivers/soc/qcom/hab/hab.c +++ b/drivers/soc/qcom/hab/hab.c @@ -54,6 +54,7 @@ static struct hab_device hab_devices[] = { HAB_DEVICE_CNSTR(DEVICE_XVM3_NAME, MM_XVM_3, 26), HAB_DEVICE_CNSTR(DEVICE_VNW1_NAME, MM_VNW_1, 27), HAB_DEVICE_CNSTR(DEVICE_EXT1_NAME, MM_EXT_1, 28), + HAB_DEVICE_CNSTR(DEVICE_GPCE1_NAME, MM_GPCE_1, 29), }; struct hab_driver hab_driver = { @@ -923,6 +924,9 @@ static int hab_generate_pchan(struct local_vmid *settings, int i, int j) case MM_EXT_START/100: ret = hab_generate_pchan_group(settings, i, j, MM_EXT_START, MM_EXT_END); break; + case MM_GPCE_START/100: + ret = hab_generate_pchan_group(settings, i, j, MM_GPCE_START, MM_GPCE_END); + break; default: pr_err("failed to find mmid %d, i %d, j %d\n", HABCFG_GET_MMID(settings, i, j), i, j); diff --git a/drivers/soc/qcom/hab/hab.h b/drivers/soc/qcom/hab/hab.h index fd5fb2511f90..c19d12402ee0 100644 --- a/drivers/soc/qcom/hab/hab.h +++ b/drivers/soc/qcom/hab/hab.h @@ -62,6 +62,7 @@ enum hab_payload_type { #define DEVICE_XVM3_NAME "hab_xvm3" #define DEVICE_VNW1_NAME "hab_vnw1" #define DEVICE_EXT1_NAME "hab_ext1" +#define DEVICE_GPCE1_NAME "hab_gpce1" #define HABCFG_MMID_NUM 26 #define HAB_MMID_ALL_AREA 0 diff --git a/include/uapi/linux/habmmid.h b/include/uapi/linux/habmmid.h index 4463fe4e402a..d13bab38f0e9 100644 --- a/include/uapi/linux/habmmid.h +++ b/include/uapi/linux/habmmid.h @@ -82,6 +82,10 @@ #define MM_EXT_1 1501 #define MM_EXT_END 1502 -#define MM_ID_MAX 1503 +#define MM_GPCE_START 1600 +#define MM_GPCE_1 1601 +#define MM_GPCE_END 1602 + +#define MM_ID_MAX 1603 #endif /* HABMMID_H */