diff options
| author | Amey Telawane <ameyt@codeaurora.org> | 2016-12-14 18:01:22 +0530 |
|---|---|---|
| committer | Amey Telawane <ameyt@codeaurora.org> | 2016-12-21 10:14:58 +0530 |
| commit | c15fe98163999e410deec057791385883e646ec8 (patch) | |
| tree | 7cb9538f433b8b98bd74233c05d7ef7edc483e94 | |
| parent | c0a8f9e80a88354a7e2271a5cb61c61ac76a8818 (diff) | |
jtag-fuse: add jtag-fuse support for etm save restore
Values stored in etm are lost across power collapse.
Enable the jtag fuses properly that helps in proper
selection of ETM register save/restore.
CRs-fixed: 1056777
Change-Id: I1cbc343ab33a8e639c4aedf0c5e0323f5730a13f
Signed-off-by: Amey Telawane <ameyt@codeaurora.org>
| -rw-r--r-- | Documentation/devicetree/bindings/arm/msm/jtag-fuse.txt | 1 | ||||
| -rw-r--r-- | drivers/soc/qcom/jtag-fuse.c | 28 |
2 files changed, 28 insertions, 1 deletions
diff --git a/Documentation/devicetree/bindings/arm/msm/jtag-fuse.txt b/Documentation/devicetree/bindings/arm/msm/jtag-fuse.txt index 9fc20315674d..ed2ac0226eab 100644 --- a/Documentation/devicetree/bindings/arm/msm/jtag-fuse.txt +++ b/Documentation/devicetree/bindings/arm/msm/jtag-fuse.txt @@ -11,6 +11,7 @@ compatible: component name used for driver matching, should be one of the "qcom,jtag-fuse" for jtag fuse device "qcom,jtag-fuse-v2" for jtag fuse v2 device "qcom,jtag-fuse-v3" for jtag fuse v3 device + "qcom,jtag-fuse-v4" for jtag fuse v4 device reg: physical base address and length of the register set reg-names: should be "fuse-base" diff --git a/drivers/soc/qcom/jtag-fuse.c b/drivers/soc/qcom/jtag-fuse.c index 0f347723e378..0c1ed2c4bae8 100644 --- a/drivers/soc/qcom/jtag-fuse.c +++ b/drivers/soc/qcom/jtag-fuse.c @@ -53,15 +53,25 @@ #define APPS_SPNIDEN_DISABLE_V3 BIT(31) #define DAP_DEVICEEN_DISABLE_V3 BIT(7) +/* JTAG FUSE V4 */ +#define ALL_DEBUG_DISABLE_V4 BIT(29) +#define APPS_DBGEN_DISABLE_V4 BIT(4) +#define APPS_NIDEN_DISABLE_V4 BIT(15) +#define APPS_SPIDEN_DISABLE_V4 BIT(28) +#define APPS_SPNIDEN_DISABLE_V4 BIT(23) +#define DAP_DEVICEEN_DISABLE_V4 BIT(3) + #define JTAG_FUSE_VERSION_V1 "qcom,jtag-fuse" #define JTAG_FUSE_VERSION_V2 "qcom,jtag-fuse-v2" #define JTAG_FUSE_VERSION_V3 "qcom,jtag-fuse-v3" +#define JTAG_FUSE_VERSION_V4 "qcom,jtag-fuse-v4" struct fuse_drvdata { void __iomem *base; struct device *dev; bool fuse_v2; bool fuse_v3; + bool fuse_v4; }; static struct fuse_drvdata *fusedrvdata; @@ -87,7 +97,20 @@ bool msm_jtag_fuse_apps_access_disabled(void) (unsigned long)config2); } - if (drvdata->fuse_v3) { + if (drvdata->fuse_v4) { + if (config0 & ALL_DEBUG_DISABLE_V4) + ret = true; + else if (config1 & APPS_DBGEN_DISABLE_V4) + ret = true; + else if (config1 & APPS_NIDEN_DISABLE_V4) + ret = true; + else if (config1 & APPS_SPIDEN_DISABLE_V4) + ret = true; + else if (config1 & APPS_SPNIDEN_DISABLE_V4) + ret = true; + else if (config1 & DAP_DEVICEEN_DISABLE_V4) + ret = true; + } else if (drvdata->fuse_v3) { if (config0 & ALL_DEBUG_DISABLE_V3) ret = true; else if (config1 & APPS_DBGEN_DISABLE_V3) @@ -139,6 +162,7 @@ static const struct of_device_id jtag_fuse_match[] = { {.compatible = JTAG_FUSE_VERSION_V1 }, {.compatible = JTAG_FUSE_VERSION_V2 }, {.compatible = JTAG_FUSE_VERSION_V3 }, + {.compatible = JTAG_FUSE_VERSION_V4 }, {} }; @@ -163,6 +187,8 @@ static int jtag_fuse_probe(struct platform_device *pdev) drvdata->fuse_v2 = true; else if (!strcmp(match->compatible, JTAG_FUSE_VERSION_V3)) drvdata->fuse_v3 = true; + else if (!strcmp(match->compatible, JTAG_FUSE_VERSION_V4)) + drvdata->fuse_v4 = true; res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "fuse-base"); if (!res) |
