Loading Documentation/devicetree/bindings/arm/coresight.txt +17 −0 Original line number Diff line number Diff line Loading @@ -159,6 +159,23 @@ its hardware characteristcs. * qcom,inst-id: must be present. QMI instance id for remote ETMs. * Optional properties for funnels: * qcom,duplicate-funnel: boolean, indicates its a duplicate of an existing funnel. Funnel devices are now capable of supporting multiple-input and multiple-output configuration with in built hardware filtering for TPDM devices. Each set of input-output combination is treated as independent funnel device. funnel-base-dummy and funnel-base-real reg-names must be specified when this property is enabled. * reg-names: funnel-base-dummy: dummy register space used by a duplicate funnel. Should be a valid register address space that no other device is using. * reg-names: funnel-base-real: actual register space for the duplicate funnel. Example: 1. Sinks Loading drivers/hwtracing/coresight/coresight-funnel.c +40 −4 Original line number Diff line number Diff line /* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved. /* Copyright (c) 2011-2012, 2017, The Linux Foundation. All rights reserved. * * Description: CoreSight Funnel driver * Loading @@ -23,6 +23,7 @@ #include <linux/coresight.h> #include <linux/amba/bus.h> #include <linux/clk.h> #include <linux/of_address.h> #include "coresight-priv.h" Loading Loading @@ -168,6 +169,29 @@ static struct attribute *coresight_funnel_attrs[] = { }; ATTRIBUTE_GROUPS(coresight_funnel); static int funnel_get_resource_byname(struct device_node *np, char *ch_base, struct resource *res) { const char *name = NULL; int index = 0, found = 0; while (!of_property_read_string_index(np, "reg-names", index, &name)) { if (strcmp(ch_base, name)) { index++; continue; } /* We have a match and @index is where it's at */ found = 1; break; } if (!found) return -EINVAL; return of_address_to_resource(np, index, res); } static int funnel_probe(struct amba_device *adev, const struct amba_id *id) { int ret; Loading @@ -175,7 +199,8 @@ static int funnel_probe(struct amba_device *adev, const struct amba_id *id) struct device *dev = &adev->dev; struct coresight_platform_data *pdata = NULL; struct funnel_drvdata *drvdata; struct resource *res = &adev->res; struct resource *res; struct resource res_real; struct coresight_desc desc = { 0 }; struct device_node *np = adev->dev.of_node; Loading @@ -199,8 +224,19 @@ static int funnel_probe(struct amba_device *adev, const struct amba_id *id) } dev_set_drvdata(dev, drvdata); /* Validity for the resource is already checked by the AMBA core */ if (of_property_read_bool(np, "qcom,duplicate-funnel")) { ret = funnel_get_resource_byname(np, "funnel-base-real", &res_real); if (ret) return ret; res = &res_real; base = devm_ioremap(dev, res->start, resource_size(res)); } else { /* Validity of resource is already checked by the AMBA core */ res = &adev->res; base = devm_ioremap_resource(dev, res); } if (IS_ERR(base)) return PTR_ERR(base); Loading Loading
Documentation/devicetree/bindings/arm/coresight.txt +17 −0 Original line number Diff line number Diff line Loading @@ -159,6 +159,23 @@ its hardware characteristcs. * qcom,inst-id: must be present. QMI instance id for remote ETMs. * Optional properties for funnels: * qcom,duplicate-funnel: boolean, indicates its a duplicate of an existing funnel. Funnel devices are now capable of supporting multiple-input and multiple-output configuration with in built hardware filtering for TPDM devices. Each set of input-output combination is treated as independent funnel device. funnel-base-dummy and funnel-base-real reg-names must be specified when this property is enabled. * reg-names: funnel-base-dummy: dummy register space used by a duplicate funnel. Should be a valid register address space that no other device is using. * reg-names: funnel-base-real: actual register space for the duplicate funnel. Example: 1. Sinks Loading
drivers/hwtracing/coresight/coresight-funnel.c +40 −4 Original line number Diff line number Diff line /* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved. /* Copyright (c) 2011-2012, 2017, The Linux Foundation. All rights reserved. * * Description: CoreSight Funnel driver * Loading @@ -23,6 +23,7 @@ #include <linux/coresight.h> #include <linux/amba/bus.h> #include <linux/clk.h> #include <linux/of_address.h> #include "coresight-priv.h" Loading Loading @@ -168,6 +169,29 @@ static struct attribute *coresight_funnel_attrs[] = { }; ATTRIBUTE_GROUPS(coresight_funnel); static int funnel_get_resource_byname(struct device_node *np, char *ch_base, struct resource *res) { const char *name = NULL; int index = 0, found = 0; while (!of_property_read_string_index(np, "reg-names", index, &name)) { if (strcmp(ch_base, name)) { index++; continue; } /* We have a match and @index is where it's at */ found = 1; break; } if (!found) return -EINVAL; return of_address_to_resource(np, index, res); } static int funnel_probe(struct amba_device *adev, const struct amba_id *id) { int ret; Loading @@ -175,7 +199,8 @@ static int funnel_probe(struct amba_device *adev, const struct amba_id *id) struct device *dev = &adev->dev; struct coresight_platform_data *pdata = NULL; struct funnel_drvdata *drvdata; struct resource *res = &adev->res; struct resource *res; struct resource res_real; struct coresight_desc desc = { 0 }; struct device_node *np = adev->dev.of_node; Loading @@ -199,8 +224,19 @@ static int funnel_probe(struct amba_device *adev, const struct amba_id *id) } dev_set_drvdata(dev, drvdata); /* Validity for the resource is already checked by the AMBA core */ if (of_property_read_bool(np, "qcom,duplicate-funnel")) { ret = funnel_get_resource_byname(np, "funnel-base-real", &res_real); if (ret) return ret; res = &res_real; base = devm_ioremap(dev, res->start, resource_size(res)); } else { /* Validity of resource is already checked by the AMBA core */ res = &adev->res; base = devm_ioremap_resource(dev, res); } if (IS_ERR(base)) return PTR_ERR(base); Loading