All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/20] coresight: Update device tree bindings
@ 2018-06-05 21:43 ` Suzuki K Poulose
  0 siblings, 0 replies; 110+ messages in thread
From: Suzuki K Poulose @ 2018-06-05 21:43 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: mathieu.poirier, robh, frowand.list, mark.rutland, sudeep.holla,
	arm, linux-kernel, matt.sealey, john.horley,
	charles.garcia-tobin, coresight, devicetree, mike.leach,
	Suzuki K Poulose

Coresight uses DT graph bindings to describe the connections of the
components. However we have some undocumented usage of the bindings
to describe some of the properties of the connections.

The coresight driver needs to know the hardware ports invovled
in the connection and the direction of data flow to effectively
manage the trace sessions. So far we have relied on the "port"
address (as described by the generic graph bindings) to represent
the hardware port of the component for a connection.

The hardware uses separate numbering scheme for input and output
ports, which implies, we could have two different (input and output)
ports with the same port number. This could create problems in the
graph bindings where the label of the port wouldn't match the address.

e.g, with the existing bindings we get :

	port@0{				// Output port 0
		reg = <0>;
		...
	};

	port@1{
		reg = <0>;		// Input port 0
		endpoint {
			slave-mode;
			...
		};
	};

With the new enforcement in the DT rules, mismatches in label and address
are not allowed (as see in the case for port@1). So, we need a new mechanism
to describe the hardware port number reliably.

Also, we relied on an undocumented "slave-mode" property (see the above
example) to indicate if the port is an input port. Let us formalise and
switch to a new property to describe the direction of data flow.

There were three options considered for the hardware port number scheme:

 1) Use natural ordering in the DT to infer the hardware port number.
  i.e, Mandate that the all ports are listed in the DT and in the ascending
  order for each class (input and output respectively).
   Pros :
      - We don't need new properties and if the existing DTS list them in
        order (which most of them do), they work out of the box.
   Cons :
      - We must list all the ports even if the system cannot/shouldn't use
        it.
      - It is prone to human errors (if the order is not kept).

 2) Use an explicit property to list both the direction and the hw port
    number and direction. Define "coresight,hwid" as 2 member array of u32,
    where the members are port number and the direction respectively.
	e.g

	port@0{
		reg = <0>;
		endpoint {
			coresight,hwid = <0 1>;	// Port # 0, Output
		}
	};

	port@1{
		reg = <1>;
		endpoint {
			coresight,hwid = <0 0>;	// Port # 0, Input
		};
	};

	Pros:
	  - The bindings are formal but not so reader friendly and could potentially
	    lead to human errors.
	Cons:
	  - Backward compatiblity is lost.
 3) Use explicit properties (implemented in the series) for the hardware
    port id and direction. We define a new property "coresight,hwid" for
    each endpoint in coresight devices to specify the hardware port number
    explicitly. Also use a separate property "direction" to specify the
    direction of the data flow.

	e.g,

	port@0{
		reg = <0>;
		endpoint {
			direction = <1>;	// Output
			coresight,hwid = <0>;	// Port # 0
		}
	};

	port@1{
		reg = <1>;
		endpoint {
			direction = <0>;	// Input
			coresight,hwid = <0>;	// Port # 0
		};
	};

    Pros:
       - The bindings are formal and reader friendly, and less prone to errors.
    Cons:
       - Backward compatibility is lost.


This series implements Option (3) listed above and falls back to the old
bindings if the new bindings are not available. This allows the systems
with old bindings work with the new driver. The driver now issues a warning
(once) when it encounters the old bindings.

It also cleans up the platform parsing code to reduce the memory usage by
reusing the platform description.

I am not sure what is the best route to push these DTS changes. Thoughts ?

Changes since RFC [0] :
 - Fixed style issues
 - Fix an existing memory leak coresight_register (Found in code update)
 - Fix missing of_node_put() in the existing driver (Reported-by Mathieu)
 - Update the existing dts in kernel tree.
 - Rename new helper functions for consistency


Suzuki K Poulose (20):
  coresight: Fix memory leak in coresight_register
  coresight: of: Fix refcounting for graph nodes
  coresight: Fix remote endpoint parsing
  coresight: Cleanup platform description data
  coresight: platform: Cleanup coresight connection handling
  coresight: Handle errors in finding input/output ports
  coresight: dts: Document usage of graph bindings
  coresight: dts: Cleanup device tree graph bindings
  coresight: dts: Define new bindings for direction of data flow
  dts: juno: Update coresight bindings for hw port
  dts: hisilicon: Update coresight bindings for hw ports
  dts: spreadtrum: Update coresight bindings for hw ports
  dts: qcom: Update coresight bindings for hw ports
  dts: arm: hisilicon: Update coresight bindings for hardware port
  dts: arm: imx7{d,s}: Update coresight binding for hardware ports
  dts: arm: omap: Update coresight bindings for hardware ports
  dts: arm: qcom: Update coresight bindings for hardware ports
  dts: sama5d2: Update coresight bindings for hardware ports
  dts: ste-dbx5x0: Update coresight bindings for hardware port
  dts: tc2: Update coresight bindings for hardware ports

 .../devicetree/bindings/arm/coresight.txt          |  76 +++++--
 arch/arm/boot/dts/hip04.dtsi                       | 195 +++++++++++++-----
 arch/arm/boot/dts/imx7d.dtsi                       |   5 +-
 arch/arm/boot/dts/imx7s.dtsi                       |  41 ++--
 arch/arm/boot/dts/omap3-beagle-xm.dts              |   5 +-
 arch/arm/boot/dts/omap3-beagle.dts                 |   5 +-
 arch/arm/boot/dts/qcom-apq8064.dtsi                |  37 +++-
 arch/arm/boot/dts/qcom-msm8974.dtsi                |  60 ++++--
 arch/arm/boot/dts/sama5d2.dtsi                     |   5 +-
 arch/arm/boot/dts/ste-dbx5x0.dtsi                  |  31 ++-
 arch/arm/boot/dts/vexpress-v2p-ca15_a7.dts         |  48 +++--
 arch/arm64/boot/dts/arm/juno-base.dtsi             |  82 +++++---
 arch/arm64/boot/dts/arm/juno-cs-r1r2.dtsi          |  26 ++-
 arch/arm64/boot/dts/arm/juno.dts                   |   5 +-
 .../arm64/boot/dts/hisilicon/hi6220-coresight.dtsi |  89 ++++++---
 arch/arm64/boot/dts/qcom/msm8916.dtsi              |  55 ++++--
 arch/arm64/boot/dts/sprd/sc9836.dtsi               |  40 ++--
 arch/arm64/boot/dts/sprd/sc9860.dtsi               | 101 +++++++---
 drivers/hwtracing/coresight/coresight.c            |  30 +--
 drivers/hwtracing/coresight/of_coresight.c         | 219 +++++++++++++--------
 include/linux/coresight.h                          |  11 +-
 21 files changed, 818 insertions(+), 348 deletions(-)

-- 
2.7.4

^ permalink raw reply	[flat|nested] 110+ messages in thread

end of thread, other threads:[~2018-07-03  8:12 UTC | newest]

Thread overview: 110+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-05 21:43 [PATCH 00/20] coresight: Update device tree bindings Suzuki K Poulose
2018-06-05 21:43 ` Suzuki K Poulose
2018-06-05 21:43 ` [PATCH 01/20] coresight: Fix memory leak in coresight_register Suzuki K Poulose
2018-06-05 21:43   ` Suzuki K Poulose
2018-06-06  6:44   ` Arvind Yadav
2018-06-06  6:44     ` Arvind Yadav
2018-06-06 10:16     ` Suzuki K Poulose
2018-06-06 10:16       ` Suzuki K Poulose
2018-06-05 21:43 ` [PATCH 02/20] coresight: of: Fix refcounting for graph nodes Suzuki K Poulose
2018-06-05 21:43   ` Suzuki K Poulose
2018-06-05 21:43   ` Suzuki K Poulose
2018-06-08 19:55   ` Mathieu Poirier
2018-06-08 19:55     ` Mathieu Poirier
2018-06-11  9:18     ` Suzuki K Poulose
2018-06-11  9:18       ` Suzuki K Poulose
2018-06-05 21:43 ` [PATCH 03/20] coresight: Fix remote endpoint parsing Suzuki K Poulose
2018-06-05 21:43   ` Suzuki K Poulose
2018-06-08 20:05   ` Mathieu Poirier
2018-06-08 20:05     ` Mathieu Poirier
2018-06-08 20:05     ` Mathieu Poirier
2018-06-05 21:43 ` [PATCH 04/20] coresight: Cleanup platform description data Suzuki K Poulose
2018-06-05 21:43   ` Suzuki K Poulose
2018-06-08 19:41   ` Mathieu Poirier
2018-06-08 19:41     ` Mathieu Poirier
2018-06-05 21:43 ` [PATCH 05/20] coresight: platform: Cleanup coresight connection handling Suzuki K Poulose
2018-06-05 21:43   ` Suzuki K Poulose
2018-06-08 20:18   ` Mathieu Poirier
2018-06-08 20:18     ` Mathieu Poirier
2018-06-05 21:43 ` [PATCH 06/20] coresight: Handle errors in finding input/output ports Suzuki K Poulose
2018-06-05 21:43   ` Suzuki K Poulose
2018-06-05 21:43   ` Suzuki K Poulose
2018-06-08 20:24   ` Mathieu Poirier
2018-06-08 20:24     ` Mathieu Poirier
2018-06-05 21:43 ` [PATCH 07/20] coresight: dts: Document usage of graph bindings Suzuki K Poulose
2018-06-05 21:43   ` Suzuki K Poulose
2018-06-08 20:30   ` Mathieu Poirier
2018-06-08 20:30     ` Mathieu Poirier
2018-06-05 21:43 ` [PATCH 08/20] coresight: dts: Cleanup device tree " Suzuki K Poulose
2018-06-05 21:43   ` Suzuki K Poulose
2018-06-08 21:22   ` Mathieu Poirier
2018-06-08 21:22     ` Mathieu Poirier
2018-06-11  9:22     ` Suzuki K Poulose
2018-06-11  9:22       ` Suzuki K Poulose
2018-06-11 16:52       ` Mathieu Poirier
2018-06-11 16:52         ` Mathieu Poirier
2018-06-11 16:55         ` Suzuki K Poulose
2018-06-11 16:55           ` Suzuki K Poulose
2018-06-11 21:51           ` Mathieu Poirier
2018-06-11 21:51             ` Mathieu Poirier
2018-06-05 21:43 ` [PATCH 09/20] coresight: dts: Define new bindings for direction of data flow Suzuki K Poulose
2018-06-05 21:43   ` Suzuki K Poulose
2018-06-08 21:39   ` Mathieu Poirier
2018-06-08 21:39     ` Mathieu Poirier
2018-06-05 21:43 ` [PATCH 10/20] dts: juno: Update coresight bindings for hw port Suzuki K Poulose
2018-06-05 21:43   ` Suzuki K Poulose
2018-06-08 21:49   ` Mathieu Poirier
2018-06-08 21:49     ` Mathieu Poirier
2018-06-08 21:52     ` Mathieu Poirier
2018-06-08 21:52       ` Mathieu Poirier
2018-06-12  9:50       ` Suzuki K Poulose
2018-06-12  9:50         ` Suzuki K Poulose
2018-06-12 10:42       ` Sudeep Holla
2018-06-12 10:42         ` Sudeep Holla
2018-06-05 21:43 ` [PATCH 11/20] dts: hisilicon: Update coresight bindings for hw ports Suzuki K Poulose
2018-06-05 21:43   ` Suzuki K Poulose
2018-06-05 21:43 ` [PATCH 12/20] dts: spreadtrum: " Suzuki K Poulose
2018-06-05 21:43   ` Suzuki K Poulose
2018-06-05 21:43 ` [PATCH 13/20] dts: qcom: " Suzuki K Poulose
2018-06-05 21:43   ` Suzuki K Poulose
2018-06-05 21:43 ` [PATCH 14/20] dts: arm: hisilicon: Update coresight bindings for hardware port Suzuki K Poulose
2018-06-05 21:43   ` Suzuki K Poulose
2018-06-05 21:43 ` [PATCH 15/20] dts: arm: imx7{d,s}: Update coresight binding for hardware ports Suzuki K Poulose
2018-06-05 21:43   ` [PATCH 15/20] dts: arm: imx7{d, s}: " Suzuki K Poulose
2018-06-19  2:12   ` [PATCH 15/20] dts: arm: imx7{d,s}: " Shawn Guo
2018-06-19  2:12     ` Shawn Guo
2018-06-19 10:35     ` Stefan Agner
2018-06-19 10:35       ` Stefan Agner
2018-06-19 14:57     ` Mathieu Poirier
2018-06-19 14:57       ` Mathieu Poirier
2018-06-05 21:43 ` [PATCH 16/20] dts: arm: omap: Update coresight bindings " Suzuki K Poulose
2018-06-05 21:43   ` Suzuki K Poulose
2018-07-03  7:09   ` Tony Lindgren
2018-07-03  7:09     ` Tony Lindgren
2018-07-03  7:59     ` Suzuki K Poulose
2018-07-03  7:59       ` Suzuki K Poulose
2018-07-03  8:12       ` Tony Lindgren
2018-07-03  8:12         ` Tony Lindgren
2018-06-05 21:43 ` [PATCH 17/20] dts: arm: qcom: " Suzuki K Poulose
2018-06-05 21:43   ` Suzuki K Poulose
2018-06-05 21:43 ` [PATCH 18/20] dts: sama5d2: " Suzuki K Poulose
2018-06-05 21:43   ` Suzuki K Poulose
2018-06-19 21:24   ` Alexandre Belloni
2018-06-19 21:24     ` Alexandre Belloni
2018-06-20  9:44     ` Suzuki K Poulose
2018-06-20  9:44       ` Suzuki K Poulose
2018-06-20 10:53       ` Alexandre Belloni
2018-06-20 10:53         ` Alexandre Belloni
2018-06-05 21:43 ` [PATCH 19/20] dts: ste-dbx5x0: Update coresight bindings for hardware port Suzuki K Poulose
2018-06-05 21:43   ` Suzuki K Poulose
2018-06-26  9:30   ` Linus Walleij
2018-06-26  9:30     ` Linus Walleij
2018-06-26  9:30     ` Linus Walleij
2018-06-26  9:31     ` Suzuki K Poulose
2018-06-26  9:31       ` Suzuki K Poulose
2018-06-26  9:31       ` Suzuki K Poulose
2018-06-05 21:43 ` [PATCH 20/20] dts: tc2: Update coresight bindings for hardware ports Suzuki K Poulose
2018-06-05 21:43   ` Suzuki K Poulose
2018-06-20  9:53 ` [PATCH 00/20] coresight: Update device tree bindings Suzuki K Poulose
2018-06-20  9:53   ` Suzuki K Poulose
2018-06-20  9:53   ` Suzuki K Poulose

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.