Skip to content

Commit 1ebcde0

Browse files
lumagandersson
authored andcommitted
soc: qcom: add pd-mapper implementation
Existing userspace protection domain mapper implementation has several issue. It doesn't play well with CONFIG_EXTRA_FIRMWARE, it doesn't reread JSON files if firmware location is changed (or if firmware was not available at the time pd-mapper was started but the corresponding directory is mounted later), etc. Provide in-kernel service implementing protection domain mapping required to work with several services, which are provided by the DSP firmware. This module is loaded automatically by the remoteproc drivers when necessary via the symbol dependency. It uses a root node to match a protection domains map for a particular board. It is not possible to implement it as a 'driver' as there is no corresponding device. Tested-by: Steev Klimaszewski <[email protected]> Tested-by: Alexey Minnekhanov <[email protected]> Reviewed-by: Chris Lew <[email protected]> Tested-by: Neil Armstrong <[email protected]> # on SM8550-QRD Signed-off-by: Dmitry Baryshkov <[email protected]> Link: https://lore.kernel.org/r/[email protected] [bjorn: include linux/slab.h] Signed-off-by: Bjorn Andersson <[email protected]>
1 parent 0ac5c7d commit 1ebcde0

File tree

5 files changed

+737
-0
lines changed

5 files changed

+737
-0
lines changed

drivers/soc/qcom/Kconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,17 @@ config QCOM_OCMEM
7272
requirements. This is typically used by the GPU, camera/video, and
7373
audio components on some Snapdragon SoCs.
7474

75+
config QCOM_PD_MAPPER
76+
tristate "Qualcomm Protection Domain Mapper"
77+
select QCOM_QMI_HELPERS
78+
depends on NET && QRTR
79+
default QCOM_RPROC_COMMON
80+
help
81+
The Protection Domain Mapper maps registered services to the domains
82+
and instances handled by the remote DSPs. This is a kernel-space
83+
implementation of the service. It is a simpler alternative to the
84+
userspace daemon.
85+
7586
config QCOM_PDR_HELPERS
7687
tristate
7788
select QCOM_QMI_HELPERS

drivers/soc/qcom/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ obj-$(CONFIG_QCOM_COMMAND_DB) += cmd-db.o
77
obj-$(CONFIG_QCOM_GSBI) += qcom_gsbi.o
88
obj-$(CONFIG_QCOM_MDT_LOADER) += mdt_loader.o
99
obj-$(CONFIG_QCOM_OCMEM) += ocmem.o
10+
obj-$(CONFIG_QCOM_PD_MAPPER) += qcom_pd_mapper.o
1011
obj-$(CONFIG_QCOM_PDR_HELPERS) += pdr_interface.o
1112
obj-$(CONFIG_QCOM_PDR_MSG) += qcom_pdr_msg.o
1213
obj-$(CONFIG_QCOM_PMIC_GLINK) += pmic_glink.o

drivers/soc/qcom/pdr_internal.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,16 @@
1313
#define SERVREG_SET_ACK_REQ 0x23
1414
#define SERVREG_RESTART_PD_REQ 0x24
1515

16+
#define SERVREG_LOC_PFR_REQ 0x24
17+
1618
#define SERVREG_DOMAIN_LIST_LENGTH 32
1719
#define SERVREG_RESTART_PD_REQ_MAX_LEN 67
1820
#define SERVREG_REGISTER_LISTENER_REQ_LEN 71
1921
#define SERVREG_SET_ACK_REQ_LEN 72
2022
#define SERVREG_GET_DOMAIN_LIST_REQ_MAX_LEN 74
2123
#define SERVREG_STATE_UPDATED_IND_MAX_LEN 79
2224
#define SERVREG_GET_DOMAIN_LIST_RESP_MAX_LEN 2389
25+
#define SERVREG_LOC_PFR_RESP_MAX_LEN 10
2326

2427
struct servreg_location_entry {
2528
char name[SERVREG_NAME_LENGTH + 1];
@@ -79,6 +82,15 @@ struct servreg_set_ack_resp {
7982
struct qmi_response_type_v01 resp;
8083
};
8184

85+
struct servreg_loc_pfr_req {
86+
char service[SERVREG_NAME_LENGTH + 1];
87+
char reason[257];
88+
};
89+
90+
struct servreg_loc_pfr_resp {
91+
struct qmi_response_type_v01 rsp;
92+
};
93+
8294
extern const struct qmi_elem_info servreg_location_entry_ei[];
8395
extern const struct qmi_elem_info servreg_get_domain_list_req_ei[];
8496
extern const struct qmi_elem_info servreg_get_domain_list_resp_ei[];
@@ -89,5 +101,7 @@ extern const struct qmi_elem_info servreg_restart_pd_resp_ei[];
89101
extern const struct qmi_elem_info servreg_state_updated_ind_ei[];
90102
extern const struct qmi_elem_info servreg_set_ack_req_ei[];
91103
extern const struct qmi_elem_info servreg_set_ack_resp_ei[];
104+
extern const struct qmi_elem_info servreg_loc_pfr_req_ei[];
105+
extern const struct qmi_elem_info servreg_loc_pfr_resp_ei[];
92106

93107
#endif

0 commit comments

Comments
 (0)