diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-06-11 15:11:23 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-06-11 15:11:23 -0400 |
| commit | b70c9d37f6b5e539798699ad4b48ed3fcd9ce282 (patch) | |
| tree | 7708fd845e624892b4bf0c46cf967490632390e5 | |
| parent | 6f75edeadd0dd3d58017bc3bcdc2b80879a7cfd3 (diff) | |
| parent | 4725496e4872824fa6182d412c66c00cae978a62 (diff) | |
Merge tag 'rproc-v4.18' of git://github.com/andersson/remoteproc
Pull remoteproc updates from Bjorn Andersson:
"This brings a few minor fixes to the Davinci driver, drops a orphan
include file from the StE cleanup done ealier and introduces support
for booting the modem on Qualcomm's SDM845 platform"
* tag 'rproc-v4.18' of git://github.com/andersson/remoteproc:
remoteproc: q6v5: Allow defining GLINK edge for mss remoteproc
remoteproc: q6v5: Add support for mss remoteproc on SDM845
remoteproc: q6v5: Introduce reset assert/deassert helper functions
dt-bindings: remoteproc: Add Q6v5 Modem PIL binding for SDM845
remoteproc: q6v5: Move proxy unvote to handover irq handler
remoteproc: q6v5: Return irq from q6v5_request_irq()
remoteproc/ste: remove abandoned include file
remoteproc/davinci: use octal permissions for module_param()
remoteproc/davinci: prepare and unprepare the clock where needed
remoteproc/davinci: add the missing retval check for clk_enable()
remoteproc: Remove depends on HAS_DMA in case of platform dependency
remoteproc: Prevent incorrect rproc state on xfer mem ownership failure
| -rw-r--r-- | Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt | 1 | ||||
| -rw-r--r-- | drivers/remoteproc/Kconfig | 1 | ||||
| -rw-r--r-- | drivers/remoteproc/da8xx_remoteproc.c | 12 | ||||
| -rw-r--r-- | drivers/remoteproc/qcom_q6v5_pil.c | 201 | ||||
| -rw-r--r-- | include/linux/ste_modem_shm.h | 56 |
5 files changed, 188 insertions, 83 deletions
diff --git a/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt b/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt index 00d3d58a102f..d90182425450 100644 --- a/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt +++ b/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt | |||
| @@ -11,6 +11,7 @@ on the Qualcomm Hexagon core. | |||
| 11 | "qcom,msm8916-mss-pil", | 11 | "qcom,msm8916-mss-pil", |
| 12 | "qcom,msm8974-mss-pil" | 12 | "qcom,msm8974-mss-pil" |
| 13 | "qcom,msm8996-mss-pil" | 13 | "qcom,msm8996-mss-pil" |
| 14 | "qcom,sdm845-mss-pil" | ||
| 14 | 15 | ||
| 15 | - reg: | 16 | - reg: |
| 16 | Usage: required | 17 | Usage: required |
diff --git a/drivers/remoteproc/Kconfig b/drivers/remoteproc/Kconfig index 027274008b08..cd1c168fd188 100644 --- a/drivers/remoteproc/Kconfig +++ b/drivers/remoteproc/Kconfig | |||
| @@ -24,7 +24,6 @@ config IMX_REMOTEPROC | |||
| 24 | 24 | ||
| 25 | config OMAP_REMOTEPROC | 25 | config OMAP_REMOTEPROC |
| 26 | tristate "OMAP remoteproc support" | 26 | tristate "OMAP remoteproc support" |
| 27 | depends on HAS_DMA | ||
| 28 | depends on ARCH_OMAP4 || SOC_OMAP5 | 27 | depends on ARCH_OMAP4 || SOC_OMAP5 |
| 29 | depends on OMAP_IOMMU | 28 | depends on OMAP_IOMMU |
| 30 | select MAILBOX | 29 | select MAILBOX |
diff --git a/drivers/remoteproc/da8xx_remoteproc.c b/drivers/remoteproc/da8xx_remoteproc.c index bf3b9034c319..b668e32996e2 100644 --- a/drivers/remoteproc/da8xx_remoteproc.c +++ b/drivers/remoteproc/da8xx_remoteproc.c | |||
| @@ -25,7 +25,7 @@ | |||
| 25 | #include "remoteproc_internal.h" | 25 | #include "remoteproc_internal.h" |
| 26 | 26 | ||
| 27 | static char *da8xx_fw_name; | 27 | static char *da8xx_fw_name; |
| 28 | module_param(da8xx_fw_name, charp, S_IRUGO); | 28 | module_param(da8xx_fw_name, charp, 0444); |
| 29 | MODULE_PARM_DESC(da8xx_fw_name, | 29 | MODULE_PARM_DESC(da8xx_fw_name, |
| 30 | "Name of DSP firmware file in /lib/firmware (if not specified defaults to 'rproc-dsp-fw')"); | 30 | "Name of DSP firmware file in /lib/firmware (if not specified defaults to 'rproc-dsp-fw')"); |
| 31 | 31 | ||
| @@ -138,6 +138,7 @@ static int da8xx_rproc_start(struct rproc *rproc) | |||
| 138 | struct device *dev = rproc->dev.parent; | 138 | struct device *dev = rproc->dev.parent; |
| 139 | struct da8xx_rproc *drproc = (struct da8xx_rproc *)rproc->priv; | 139 | struct da8xx_rproc *drproc = (struct da8xx_rproc *)rproc->priv; |
| 140 | struct clk *dsp_clk = drproc->dsp_clk; | 140 | struct clk *dsp_clk = drproc->dsp_clk; |
| 141 | int ret; | ||
| 141 | 142 | ||
| 142 | /* hw requires the start (boot) address be on 1KB boundary */ | 143 | /* hw requires the start (boot) address be on 1KB boundary */ |
| 143 | if (rproc->bootaddr & 0x3ff) { | 144 | if (rproc->bootaddr & 0x3ff) { |
| @@ -148,7 +149,12 @@ static int da8xx_rproc_start(struct rproc *rproc) | |||
| 148 | 149 | ||
| 149 | writel(rproc->bootaddr, drproc->bootreg); | 150 | writel(rproc->bootaddr, drproc->bootreg); |
| 150 | 151 | ||
| 151 | clk_enable(dsp_clk); | 152 | ret = clk_prepare_enable(dsp_clk); |
| 153 | if (ret) { | ||
| 154 | dev_err(dev, "clk_prepare_enable() failed: %d\n", ret); | ||
| 155 | return ret; | ||
| 156 | } | ||
| 157 | |||
| 152 | davinci_clk_reset_deassert(dsp_clk); | 158 | davinci_clk_reset_deassert(dsp_clk); |
| 153 | 159 | ||
| 154 | return 0; | 160 | return 0; |
| @@ -159,7 +165,7 @@ static int da8xx_rproc_stop(struct rproc *rproc) | |||
| 159 | struct da8xx_rproc *drproc = rproc->priv; | 165 | struct da8xx_rproc *drproc = rproc->priv; |
| 160 | 166 | ||
| 161 | davinci_clk_reset_assert(drproc->dsp_clk); | 167 | davinci_clk_reset_assert(drproc->dsp_clk); |
| 162 | clk_disable(drproc->dsp_clk); | 168 | clk_disable_unprepare(drproc->dsp_clk); |
| 163 | 169 | ||
| 164 | return 0; | 170 | return 0; |
| 165 | } | 171 | } |
diff --git a/drivers/remoteproc/qcom_q6v5_pil.c b/drivers/remoteproc/qcom_q6v5_pil.c index cbbafdcaaecb..2190debf3d35 100644 --- a/drivers/remoteproc/qcom_q6v5_pil.c +++ b/drivers/remoteproc/qcom_q6v5_pil.c | |||
| @@ -57,6 +57,8 @@ | |||
| 57 | #define RMB_PMI_META_DATA_REG 0x10 | 57 | #define RMB_PMI_META_DATA_REG 0x10 |
| 58 | #define RMB_PMI_CODE_START_REG 0x14 | 58 | #define RMB_PMI_CODE_START_REG 0x14 |
| 59 | #define RMB_PMI_CODE_LENGTH_REG 0x18 | 59 | #define RMB_PMI_CODE_LENGTH_REG 0x18 |
| 60 | #define RMB_MBA_MSS_STATUS 0x40 | ||
| 61 | #define RMB_MBA_ALT_RESET 0x44 | ||
| 60 | 62 | ||
| 61 | #define RMB_CMD_META_DATA_READY 0x1 | 63 | #define RMB_CMD_META_DATA_READY 0x1 |
| 62 | #define RMB_CMD_LOAD_READY 0x2 | 64 | #define RMB_CMD_LOAD_READY 0x2 |
| @@ -104,6 +106,13 @@ | |||
| 104 | #define QDSP6SS_XO_CBCR 0x0038 | 106 | #define QDSP6SS_XO_CBCR 0x0038 |
| 105 | #define QDSP6SS_ACC_OVERRIDE_VAL 0x20 | 107 | #define QDSP6SS_ACC_OVERRIDE_VAL 0x20 |
| 106 | 108 | ||
| 109 | /* QDSP6v65 parameters */ | ||
| 110 | #define QDSP6SS_SLEEP 0x3C | ||
| 111 | #define QDSP6SS_BOOT_CORE_START 0x400 | ||
| 112 | #define QDSP6SS_BOOT_CMD 0x404 | ||
| 113 | #define SLEEP_CHECK_MAX_LOOPS 200 | ||
| 114 | #define BOOT_FSM_TIMEOUT 10000 | ||
| 115 | |||
| 107 | struct reg_info { | 116 | struct reg_info { |
| 108 | struct regulator *reg; | 117 | struct regulator *reg; |
| 109 | int uV; | 118 | int uV; |
| @@ -121,9 +130,11 @@ struct rproc_hexagon_res { | |||
| 121 | struct qcom_mss_reg_res *proxy_supply; | 130 | struct qcom_mss_reg_res *proxy_supply; |
| 122 | struct qcom_mss_reg_res *active_supply; | 131 | struct qcom_mss_reg_res *active_supply; |
| 123 | char **proxy_clk_names; | 132 | char **proxy_clk_names; |
| 133 | char **reset_clk_names; | ||
| 124 | char **active_clk_names; | 134 | char **active_clk_names; |
| 125 | int version; | 135 | int version; |
| 126 | bool need_mem_protection; | 136 | bool need_mem_protection; |
| 137 | bool has_alt_reset; | ||
| 127 | }; | 138 | }; |
| 128 | 139 | ||
| 129 | struct q6v5 { | 140 | struct q6v5 { |
| @@ -143,9 +154,15 @@ struct q6v5 { | |||
| 143 | struct qcom_smem_state *state; | 154 | struct qcom_smem_state *state; |
| 144 | unsigned stop_bit; | 155 | unsigned stop_bit; |
| 145 | 156 | ||
| 157 | int handover_irq; | ||
| 158 | |||
| 159 | bool proxy_unvoted; | ||
| 160 | |||
| 146 | struct clk *active_clks[8]; | 161 | struct clk *active_clks[8]; |
| 162 | struct clk *reset_clks[4]; | ||
| 147 | struct clk *proxy_clks[4]; | 163 | struct clk *proxy_clks[4]; |
| 148 | int active_clk_count; | 164 | int active_clk_count; |
| 165 | int reset_clk_count; | ||
| 149 | int proxy_clk_count; | 166 | int proxy_clk_count; |
| 150 | 167 | ||
| 151 | struct reg_info active_regs[1]; | 168 | struct reg_info active_regs[1]; |
| @@ -166,10 +183,12 @@ struct q6v5 { | |||
| 166 | void *mpss_region; | 183 | void *mpss_region; |
| 167 | size_t mpss_size; | 184 | size_t mpss_size; |
| 168 | 185 | ||
| 186 | struct qcom_rproc_glink glink_subdev; | ||
| 169 | struct qcom_rproc_subdev smd_subdev; | 187 | struct qcom_rproc_subdev smd_subdev; |
| 170 | struct qcom_rproc_ssr ssr_subdev; | 188 | struct qcom_rproc_ssr ssr_subdev; |
| 171 | struct qcom_sysmon *sysmon; | 189 | struct qcom_sysmon *sysmon; |
| 172 | bool need_mem_protection; | 190 | bool need_mem_protection; |
| 191 | bool has_alt_reset; | ||
| 173 | int mpss_perm; | 192 | int mpss_perm; |
| 174 | int mba_perm; | 193 | int mba_perm; |
| 175 | int version; | 194 | int version; |
| @@ -179,6 +198,7 @@ enum { | |||
| 179 | MSS_MSM8916, | 198 | MSS_MSM8916, |
| 180 | MSS_MSM8974, | 199 | MSS_MSM8974, |
| 181 | MSS_MSM8996, | 200 | MSS_MSM8996, |
| 201 | MSS_SDM845, | ||
| 182 | }; | 202 | }; |
| 183 | 203 | ||
| 184 | static int q6v5_regulator_init(struct device *dev, struct reg_info *regs, | 204 | static int q6v5_regulator_init(struct device *dev, struct reg_info *regs, |
| @@ -333,6 +353,29 @@ static int q6v5_load(struct rproc *rproc, const struct firmware *fw) | |||
| 333 | return 0; | 353 | return 0; |
| 334 | } | 354 | } |
| 335 | 355 | ||
| 356 | static int q6v5_reset_assert(struct q6v5 *qproc) | ||
| 357 | { | ||
| 358 | if (qproc->has_alt_reset) | ||
| 359 | return reset_control_reset(qproc->mss_restart); | ||
| 360 | else | ||
| 361 | return reset_control_assert(qproc->mss_restart); | ||
| 362 | } | ||
| 363 | |||
| 364 | static int q6v5_reset_deassert(struct q6v5 *qproc) | ||
| 365 | { | ||
| 366 | int ret; | ||
| 367 | |||
| 368 | if (qproc->has_alt_reset) { | ||
| 369 | writel(1, qproc->rmb_base + RMB_MBA_ALT_RESET); | ||
| 370 | ret = reset_control_reset(qproc->mss_restart); | ||
| 371 | writel(0, qproc->rmb_base + RMB_MBA_ALT_RESET); | ||
