Skip to content

Commit

Permalink
[UPSTREAM] soc: qcom: add pd-mapper implementation
Browse files Browse the repository at this point in the history
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]>
Signed-off-by: Dmitry Baryshkov <[email protected]>
  • Loading branch information
lumag authored and minlexx committed Jul 14, 2024
1 parent 6822c10 commit f5fe6bb
Show file tree
Hide file tree
Showing 5 changed files with 736 additions and 0 deletions.
11 changes: 11 additions & 0 deletions drivers/soc/qcom/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,17 @@ config QCOM_OCMEM
requirements. This is typically used by the GPU, camera/video, and
audio components on some Snapdragon SoCs.

config QCOM_PD_MAPPER
tristate "Qualcomm Protection Domain Mapper"
select QCOM_QMI_HELPERS
depends on NET && QRTR
default QCOM_RPROC_COMMON
help
The Protection Domain Mapper maps registered services to the domains
and instances handled by the remote DSPs. This is a kernel-space
implementation of the service. It is a simpler alternative to the
userspace daemon.

config QCOM_PDR_HELPERS
tristate
select QCOM_QMI_HELPERS
Expand Down
1 change: 1 addition & 0 deletions drivers/soc/qcom/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ obj-$(CONFIG_QCOM_COMMAND_DB) += cmd-db.o
obj-$(CONFIG_QCOM_GSBI) += qcom_gsbi.o
obj-$(CONFIG_QCOM_MDT_LOADER) += mdt_loader.o
obj-$(CONFIG_QCOM_OCMEM) += ocmem.o
obj-$(CONFIG_QCOM_PD_MAPPER) += qcom_pd_mapper.o
obj-$(CONFIG_QCOM_PDR_HELPERS) += pdr_interface.o
obj-$(CONFIG_QCOM_PDR_MSG) += qcom_pdr_msg.o
obj-$(CONFIG_QCOM_PMIC_GLINK) += pmic_glink.o
Expand Down
14 changes: 14 additions & 0 deletions drivers/soc/qcom/pdr_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,16 @@
#define SERVREG_SET_ACK_REQ 0x23
#define SERVREG_RESTART_PD_REQ 0x24

#define SERVREG_LOC_PFR_REQ 0x24

#define SERVREG_DOMAIN_LIST_LENGTH 32
#define SERVREG_RESTART_PD_REQ_MAX_LEN 67
#define SERVREG_REGISTER_LISTENER_REQ_LEN 71
#define SERVREG_SET_ACK_REQ_LEN 72
#define SERVREG_GET_DOMAIN_LIST_REQ_MAX_LEN 74
#define SERVREG_STATE_UPDATED_IND_MAX_LEN 79
#define SERVREG_GET_DOMAIN_LIST_RESP_MAX_LEN 2389
#define SERVREG_LOC_PFR_RESP_MAX_LEN 10

struct servreg_location_entry {
char name[SERVREG_NAME_LENGTH + 1];
Expand Down Expand Up @@ -79,6 +82,15 @@ struct servreg_set_ack_resp {
struct qmi_response_type_v01 resp;
};

struct servreg_loc_pfr_req {
char service[SERVREG_NAME_LENGTH + 1];
char reason[257];
};

struct servreg_loc_pfr_resp {
struct qmi_response_type_v01 rsp;
};

extern const struct qmi_elem_info servreg_location_entry_ei[];
extern const struct qmi_elem_info servreg_get_domain_list_req_ei[];
extern const struct qmi_elem_info servreg_get_domain_list_resp_ei[];
Expand All @@ -89,5 +101,7 @@ extern const struct qmi_elem_info servreg_restart_pd_resp_ei[];
extern const struct qmi_elem_info servreg_state_updated_ind_ei[];
extern const struct qmi_elem_info servreg_set_ack_req_ei[];
extern const struct qmi_elem_info servreg_set_ack_resp_ei[];
extern const struct qmi_elem_info servreg_loc_pfr_req_ei[];
extern const struct qmi_elem_info servreg_loc_pfr_resp_ei[];

#endif
Loading

0 comments on commit f5fe6bb

Please sign in to comment.