mbox series

[v4,0/3] coresight: Add static trace id support

Message ID 20240729071414.5410-1-quic_jinlmao@quicinc.com
Headers show
Series coresight: Add static trace id support | expand

Message

Mao Jinlong July 29, 2024, 7:14 a.m. UTC
Some HW has static trace id which cannot be changed via
software programming. For this case, configure the trace id
in device tree with "arm,static-trace-id = <xxx>", and
call coresight_trace_id_get_static_system_id with the trace id value
in device probe function. The id will be reserved for the HW
all the time if the device is probed.

Changes since V3:
1. Adda new API function
int coresight_trace_id_get_system_static_id(int trace_id).
2. Use the term "static trace id" for these devices where
the hardware sets a non-programmable trace ID. 

Changes since V2:
1. Change "trace-id" to "arm,trace-id".
2. Add trace id flag for getting preferred id or ODD id.

Changes since V1:
1. Add argument to coresight_trace_id_get_system_id for preferred id
instead of adding new function coresight_trace_id_reserve_system_id.
2. Add constraint to trace-id in dt-binding file.

Mao Jinlong (3):
  dt-bindings: arm: Add arm,trace-id for coresight dummy source
  coresight: Add support to get static id for system trace sources
  coresight: dummy: Add static trace id support for dummy source

 .../sysfs-bus-coresight-devices-dummy-source  | 15 +++++
 .../arm/arm,coresight-dummy-source.yaml       |  6 ++
 drivers/hwtracing/coresight/coresight-dummy.c | 59 +++++++++++++++++--
 .../hwtracing/coresight/coresight-platform.c  | 26 ++++++++
 .../hwtracing/coresight/coresight-trace-id.c  | 38 ++++++++----
 .../hwtracing/coresight/coresight-trace-id.h  |  9 +++
 include/linux/coresight.h                     |  1 +
 7 files changed, 140 insertions(+), 14 deletions(-)
 create mode 100644 Documentation/ABI/testing/sysfs-bus-coresight-devices-dummy-source

Comments

Mao Jinlong Aug. 21, 2024, 8:22 a.m. UTC | #1
On 2024/7/29 15:14, Mao Jinlong wrote:
> Some HW has static trace id which cannot be changed via
> software programming. For this case, configure the trace id
> in device tree with "arm,static-trace-id = <xxx>", and
> call coresight_trace_id_get_static_system_id with the trace id value
> in device probe function. The id will be reserved for the HW
> all the time if the device is probed.
> 
> Changes since V3:
> 1. Adda new API function
> int coresight_trace_id_get_system_static_id(int trace_id).
> 2. Use the term "static trace id" for these devices where
> the hardware sets a non-programmable trace ID.
> 
> Changes since V2:
> 1. Change "trace-id" to "arm,trace-id".
> 2. Add trace id flag for getting preferred id or ODD id.
> 
> Changes since V1:
> 1. Add argument to coresight_trace_id_get_system_id for preferred id
> instead of adding new function coresight_trace_id_reserve_system_id.
> 2. Add constraint to trace-id in dt-binding file.
> 
> Mao Jinlong (3):
>    dt-bindings: arm: Add arm,trace-id for coresight dummy source
>    coresight: Add support to get static id for system trace sources
>    coresight: dummy: Add static trace id support for dummy source
> 
>   .../sysfs-bus-coresight-devices-dummy-source  | 15 +++++
>   .../arm/arm,coresight-dummy-source.yaml       |  6 ++
>   drivers/hwtracing/coresight/coresight-dummy.c | 59 +++++++++++++++++--
>   .../hwtracing/coresight/coresight-platform.c  | 26 ++++++++
>   .../hwtracing/coresight/coresight-trace-id.c  | 38 ++++++++----
>   .../hwtracing/coresight/coresight-trace-id.h  |  9 +++
>   include/linux/coresight.h                     |  1 +
>   7 files changed, 140 insertions(+), 14 deletions(-)
>   create mode 100644 Documentation/ABI/testing/sysfs-bus-coresight-devices-dummy-source

Hi Reviewers,

Gentle remainder for the review.

Thanks
Jinlong Mao

>
Mike Leach Oct. 16, 2024, 10:12 a.m. UTC | #2
On Mon, 29 Jul 2024 at 08:14, Mao Jinlong <quic_jinlmao@quicinc.com> wrote:
>
> Some dummy source HW has static trace id which cannot be changed via
> software programming. Add arm,trace-id for static id support to
> coresight dummy source.
>
> Signed-off-by: Mao Jinlong <quic_jinlmao@quicinc.com>
> Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
> ---
>  .../devicetree/bindings/arm/arm,coresight-dummy-source.yaml | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/arm/arm,coresight-dummy-source.yaml b/Documentation/devicetree/bindings/arm/arm,coresight-dummy-source.yaml
> index 6745b4cc8f1c..ecf3ba9cdd22 100644
> --- a/Documentation/devicetree/bindings/arm/arm,coresight-dummy-source.yaml
> +++ b/Documentation/devicetree/bindings/arm/arm,coresight-dummy-source.yaml
> @@ -38,6 +38,12 @@ properties:
>      enum:
>        - arm,coresight-dummy-source
>
> +  arm,static-trace-id:
> +    description: If dummy source needs static id support, use this to set trace id.
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    minimum: 1
> +    maximum: 111
> +
>    out-ports:
>      $ref: /schemas/graph.yaml#/properties/ports
>
> --
> 2.41.0
>

Reviewed-by: Mike Leach <mike.leach@linaro.org>