From 49306401ba0ce0fc833ea2655df237b2fd916a62 Mon Sep 17 00:00:00 2001 From: Pratik Patel Date: Fri, 14 Jun 2013 01:02:08 -0700 Subject: [PATCH] coresight: add coresight fuse state query Add support to query CoreSight fuse state and fail the probe if any of the required fuse(s) are disabled. This enables a single image with CoreSight drivers compiled in to be run on both Hardware that has CoreSight functionality disabled via fuse or left enabled for use. Change-Id: Ib770cc7f76e2b0644bda9600c92fc3a26823452d Signed-off-by: Pratik Patel --- drivers/coresight/coresight-csr.c | 3 +++ drivers/coresight/coresight-cti.c | 3 +++ drivers/coresight/coresight-etb.c | 3 +++ drivers/coresight/coresight-etm.c | 4 ++++ drivers/coresight/coresight-funnel.c | 3 +++ drivers/coresight/coresight-hwevent.c | 3 +++ drivers/coresight/coresight-replicator.c | 3 +++ drivers/coresight/coresight-stm.c | 3 +++ drivers/coresight/coresight-tmc.c | 3 +++ drivers/coresight/coresight-tpiu.c | 3 +++ 10 files changed, 31 insertions(+) diff --git a/drivers/coresight/coresight-csr.c b/drivers/coresight/coresight-csr.c index 8195184bdad..132df904bd2 100644 --- a/drivers/coresight/coresight-csr.c +++ b/drivers/coresight/coresight-csr.c @@ -168,6 +168,9 @@ static int __devinit csr_probe(struct platform_device *pdev) struct resource *res; struct coresight_desc *desc; + if (coresight_fuse_access_disabled()) + return -EPERM; + if (pdev->dev.of_node) { pdata = of_get_coresight_platform_data(dev, pdev->dev.of_node); if (IS_ERR(pdata)) diff --git a/drivers/coresight/coresight-cti.c b/drivers/coresight/coresight-cti.c index 6a8d4123ee0..d0900d10fde 100644 --- a/drivers/coresight/coresight-cti.c +++ b/drivers/coresight/coresight-cti.c @@ -388,6 +388,9 @@ static int __devinit cti_probe(struct platform_device *pdev) struct resource *res; struct coresight_desc *desc; + if (coresight_fuse_access_disabled()) + return -EPERM; + if (pdev->dev.of_node) { pdata = of_get_coresight_platform_data(dev, pdev->dev.of_node); if (IS_ERR(pdata)) diff --git a/drivers/coresight/coresight-etb.c b/drivers/coresight/coresight-etb.c index 31f85dc924a..473b4cba3d6 100644 --- a/drivers/coresight/coresight-etb.c +++ b/drivers/coresight/coresight-etb.c @@ -362,6 +362,9 @@ static int __devinit etb_probe(struct platform_device *pdev) struct resource *res; struct coresight_desc *desc; + if (coresight_fuse_access_disabled()) + return -EPERM; + if (pdev->dev.of_node) { pdata = of_get_coresight_platform_data(dev, pdev->dev.of_node); if (IS_ERR(pdata)) diff --git a/drivers/coresight/coresight-etm.c b/drivers/coresight/coresight-etm.c index de866223308..52f3027536c 100644 --- a/drivers/coresight/coresight-etm.c +++ b/drivers/coresight/coresight-etm.c @@ -2113,6 +2113,10 @@ static int __devinit etm_probe(struct platform_device *pdev) struct msm_client_dump dump; struct coresight_desc *desc; + if (coresight_fuse_access_disabled() || + coresight_fuse_apps_access_disabled()) + return -EPERM; + if (pdev->dev.of_node) { pdata = of_get_coresight_platform_data(dev, pdev->dev.of_node); if (IS_ERR(pdata)) diff --git a/drivers/coresight/coresight-funnel.c b/drivers/coresight/coresight-funnel.c index 625f4814df0..771321d1cdb 100644 --- a/drivers/coresight/coresight-funnel.c +++ b/drivers/coresight/coresight-funnel.c @@ -174,6 +174,9 @@ static int __devinit funnel_probe(struct platform_device *pdev) struct resource *res; struct coresight_desc *desc; + if (coresight_fuse_access_disabled()) + return -EPERM; + if (pdev->dev.of_node) { pdata = of_get_coresight_platform_data(dev, pdev->dev.of_node); if (IS_ERR(pdata)) diff --git a/drivers/coresight/coresight-hwevent.c b/drivers/coresight/coresight-hwevent.c index 777484d71c2..269d56e0157 100644 --- a/drivers/coresight/coresight-hwevent.c +++ b/drivers/coresight/coresight-hwevent.c @@ -211,6 +211,9 @@ static int __devinit hwevent_probe(struct platform_device *pdev) int ret, i; const char *hmux_name, *hclk_name; + if (coresight_fuse_access_disabled()) + return -EPERM; + if (pdev->dev.of_node) { pdata = of_get_coresight_platform_data(dev, pdev->dev.of_node); if (IS_ERR(pdata)) diff --git a/drivers/coresight/coresight-replicator.c b/drivers/coresight/coresight-replicator.c index d4afa420e7d..9f70dc7a650 100644 --- a/drivers/coresight/coresight-replicator.c +++ b/drivers/coresight/coresight-replicator.c @@ -126,6 +126,9 @@ static int __devinit replicator_probe(struct platform_device *pdev) struct resource *res; struct coresight_desc *desc; + if (coresight_fuse_access_disabled()) + return -EPERM; + if (pdev->dev.of_node) { pdata = of_get_coresight_platform_data(dev, pdev->dev.of_node); if (IS_ERR(pdata)) diff --git a/drivers/coresight/coresight-stm.c b/drivers/coresight/coresight-stm.c index 7d4dabed10a..085f7211669 100644 --- a/drivers/coresight/coresight-stm.c +++ b/drivers/coresight/coresight-stm.c @@ -791,6 +791,9 @@ static int __devinit stm_probe(struct platform_device *pdev) size_t res_size, bitmap_size; struct coresight_desc *desc; + if (coresight_fuse_access_disabled()) + return -EPERM; + if (pdev->dev.of_node) { pdata = of_get_coresight_platform_data(dev, pdev->dev.of_node); if (IS_ERR(pdata)) diff --git a/drivers/coresight/coresight-tmc.c b/drivers/coresight/coresight-tmc.c index f39334a6a68..4186abea7d2 100644 --- a/drivers/coresight/coresight-tmc.c +++ b/drivers/coresight/coresight-tmc.c @@ -1134,6 +1134,9 @@ static int __devinit tmc_probe(struct platform_device *pdev) struct coresight_cti_data *ctidata; struct coresight_desc *desc; + if (coresight_fuse_access_disabled()) + return -EPERM; + if (pdev->dev.of_node) { pdata = of_get_coresight_platform_data(dev, pdev->dev.of_node); if (IS_ERR(pdata)) diff --git a/drivers/coresight/coresight-tpiu.c b/drivers/coresight/coresight-tpiu.c index 53df0f9dc0f..032327cf3fa 100644 --- a/drivers/coresight/coresight-tpiu.c +++ b/drivers/coresight/coresight-tpiu.c @@ -717,6 +717,9 @@ static int __devinit tpiu_probe(struct platform_device *pdev) struct resource *res; struct coresight_desc *desc; + if (coresight_fuse_access_disabled()) + return -EPERM; + if (pdev->dev.of_node) { pdata = of_get_coresight_platform_data(dev, pdev->dev.of_node); if (IS_ERR(pdata))