diff mbox

[09/11,v4] coresight: adding support for beagle and beagleXM

Message ID 1408554231-24321-10-git-send-email-mathieu.poirier@linaro.org (mailing list archive)
State New, archived
Headers show

Commit Message

Mathieu Poirier Aug. 20, 2014, 5:03 p.m. UTC
From: Mathieu Poirier <mathieu.poirier@linaro.org>

Currently supporting ETM and ETB.  Support for TPIU
and SDTI are yet to be added.

Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
---
 arch/arm/boot/dts/omap3-beagle-xm.dts | 28 ++++++++++++++++++++++++++++
 arch/arm/boot/dts/omap3-beagle.dts    | 28 ++++++++++++++++++++++++++++
 2 files changed, 56 insertions(+)

Comments

Marcin Jabrzyk Aug. 24, 2014, 9:38 p.m. UTC | #1
Hi,

W dniu 20.08.2014 o 19:03, mathieu.poirier@linaro.org pisze:
> From: Mathieu Poirier <mathieu.poirier@linaro.org>
>
> Currently supporting ETM and ETB.  Support for TPIU
> and SDTI are yet to be added.
Did you tried running the drivers on board or are there any special
preparation needed?
I've BeagleBoard-xM Rev. C applied your patches and enabled the
functions the in menuconfig.
But on dmesg I see that:

[    0.685028] of_amba_device_create(): amba_device_add() failed (-19)
for /etb@5401b000
[    0.685119] of_amba_device_create(): amba_device_add() failed (-19)
for /etm@54010000

There are no nodes according coresight in /sys/kernel/debug/ .

Best regards,
Marcin

>
> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
> ---
>  arch/arm/boot/dts/omap3-beagle-xm.dts | 28 ++++++++++++++++++++++++++++
>  arch/arm/boot/dts/omap3-beagle.dts    | 28 ++++++++++++++++++++++++++++
>  2 files changed, 56 insertions(+)
>
> diff --git a/arch/arm/boot/dts/omap3-beagle-xm.dts b/arch/arm/boot/dts/omap3-beagle-xm.dts
> index 1becefc..eec73d8 100644
> --- a/arch/arm/boot/dts/omap3-beagle-xm.dts
> +++ b/arch/arm/boot/dts/omap3-beagle-xm.dts
> @@ -145,6 +145,34 @@
>  			};
>  		};
>  	};
> +
> +	etb@5401b000 {
> +		compatible = "arm,coresight-etb10", "arm,primecell";
> +		reg = <0x5401b000 0x1000>;
> +
> +		coresight-default-sink;
> +		clocks = <&emu_src_ck>;
> +		clock-names = "apb_pclk";
> +		port {
> +			etb_in: endpoint {
> +				slave-mode;
> +				remote-endpoint = <&etm_out>;
> +			};
> +		};
> +	};
> +
> +	etm@54010000 {
> +		compatible = "arm,coresight-etm3x", "arm,primecell";
> +		reg = <0x54010000 0x1000>;
> +
> +		clocks = <&emu_src_ck>;
> +		clock-names = "apb_pclk";
> +		port {
> +			etm_out: endpoint {
> +				remote-endpoint = <&etb_in>;
> +			};
> +		};
> +	};
>  };
>  
>  &omap3_pmx_wkup {
> diff --git a/arch/arm/boot/dts/omap3-beagle.dts b/arch/arm/boot/dts/omap3-beagle.dts
> index 3c3e6da..a151daf 100644
> --- a/arch/arm/boot/dts/omap3-beagle.dts
> +++ b/arch/arm/boot/dts/omap3-beagle.dts
> @@ -140,6 +140,34 @@
>  			};
>  		};
>  	};
> +
> +	etb@540000000 {
> +		compatible = "arm,coresight-etb10", "arm,primecell";
> +		reg = <0x5401b000 0x1000>;
> +
> +		coresight-default-sink;
> +		clocks = <&emu_src_ck>;
> +		clock-names = "apb_pclk";
> +		port {
> +			etb_in: endpoint {
> +				slave-mode;
> +				remote-endpoint = <&etm_out>;
> +			};
> +		};
> +	};
> +
> +	etm@54010000 {
> +		compatible = "arm,coresight-etm3x", "arm,primecell";
> +		reg = <0x54010000 0x1000>;
> +
> +		clocks = <&emu_src_ck>;
> +		clock-names = "apb_pclk";
> +		port {
> +			etm_out: endpoint {
> +				remote-endpoint = <&etb_in>;
> +			};
> +		};
> +	};
>  };
>  
>  &omap3_pmx_wkup {
Mathieu Poirier Aug. 25, 2014, 2:02 p.m. UTC | #2
On 24 August 2014 15:38, Marcin Jabrzyk <marcin.jabrzyk@gmail.com> wrote:
> Hi,
>
> W dniu 20.08.2014 o 19:03, mathieu.poirier@linaro.org pisze:
>> From: Mathieu Poirier <mathieu.poirier@linaro.org>
>>
>> Currently supporting ETM and ETB.  Support for TPIU
>> and SDTI are yet to be added.
> Did you tried running the drivers on board or are there any special
> preparation needed?
> I've BeagleBoard-xM Rev. C applied your patches and enabled the
> functions the in menuconfig.
> But on dmesg I see that:
>
> [    0.685028] of_amba_device_create(): amba_device_add() failed (-19)
> for /etb@5401b000
> [    0.685119] of_amba_device_create(): amba_device_add() failed (-19)
> for /etm@54010000
>
> There are no nodes according coresight in /sys/kernel/debug/ .

Right, that is because there is a problem in mainline with enabling
"emu_src_ck".  The call to "clk_prepare_enable()" returns without
waiting for the clock to effectively be enabled, preventing the
components from being discovered properly.

The work around (non-upstreamable) is to have a driver getting a hold
of the clock before AMBA devices are probed.  I can send you that code
(10 lines) if need be.

>
> Best regards,
> Marcin
>
>>
>> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
>> ---
>>  arch/arm/boot/dts/omap3-beagle-xm.dts | 28 ++++++++++++++++++++++++++++
>>  arch/arm/boot/dts/omap3-beagle.dts    | 28 ++++++++++++++++++++++++++++
>>  2 files changed, 56 insertions(+)
>>
>> diff --git a/arch/arm/boot/dts/omap3-beagle-xm.dts b/arch/arm/boot/dts/omap3-beagle-xm.dts
>> index 1becefc..eec73d8 100644
>> --- a/arch/arm/boot/dts/omap3-beagle-xm.dts
>> +++ b/arch/arm/boot/dts/omap3-beagle-xm.dts
>> @@ -145,6 +145,34 @@
>>                       };
>>               };
>>       };
>> +
>> +     etb@5401b000 {
>> +             compatible = "arm,coresight-etb10", "arm,primecell";
>> +             reg = <0x5401b000 0x1000>;
>> +
>> +             coresight-default-sink;
>> +             clocks = <&emu_src_ck>;
>> +             clock-names = "apb_pclk";
>> +             port {
>> +                     etb_in: endpoint {
>> +                             slave-mode;
>> +                             remote-endpoint = <&etm_out>;
>> +                     };
>> +             };
>> +     };
>> +
>> +     etm@54010000 {
>> +             compatible = "arm,coresight-etm3x", "arm,primecell";
>> +             reg = <0x54010000 0x1000>;
>> +
>> +             clocks = <&emu_src_ck>;
>> +             clock-names = "apb_pclk";
>> +             port {
>> +                     etm_out: endpoint {
>> +                             remote-endpoint = <&etb_in>;
>> +                     };
>> +             };
>> +     };
>>  };
>>
>>  &omap3_pmx_wkup {
>> diff --git a/arch/arm/boot/dts/omap3-beagle.dts b/arch/arm/boot/dts/omap3-beagle.dts
>> index 3c3e6da..a151daf 100644
>> --- a/arch/arm/boot/dts/omap3-beagle.dts
>> +++ b/arch/arm/boot/dts/omap3-beagle.dts
>> @@ -140,6 +140,34 @@
>>                       };
>>               };
>>       };
>> +
>> +     etb@540000000 {
>> +             compatible = "arm,coresight-etb10", "arm,primecell";
>> +             reg = <0x5401b000 0x1000>;
>> +
>> +             coresight-default-sink;
>> +             clocks = <&emu_src_ck>;
>> +             clock-names = "apb_pclk";
>> +             port {
>> +                     etb_in: endpoint {
>> +                             slave-mode;
>> +                             remote-endpoint = <&etm_out>;
>> +                     };
>> +             };
>> +     };
>> +
>> +     etm@54010000 {
>> +             compatible = "arm,coresight-etm3x", "arm,primecell";
>> +             reg = <0x54010000 0x1000>;
>> +
>> +             clocks = <&emu_src_ck>;
>> +             clock-names = "apb_pclk";
>> +             port {
>> +                     etm_out: endpoint {
>> +                             remote-endpoint = <&etb_in>;
>> +                     };
>> +             };
>> +     };
>>  };
>>
>>  &omap3_pmx_wkup {
>
Marcin Jabrzyk Aug. 25, 2014, 9:01 p.m. UTC | #3
Hello,

W dniu 25.08.2014 o 16:02, Mathieu Poirier pisze:
> On 24 August 2014 15:38, Marcin Jabrzyk <marcin.jabrzyk@gmail.com> wrote:
>> Hi,
>>
>> W dniu 20.08.2014 o 19:03, mathieu.poirier@linaro.org pisze:
>>> From: Mathieu Poirier <mathieu.poirier@linaro.org>
>>>
>>> Currently supporting ETM and ETB.  Support for TPIU
>>> and SDTI are yet to be added.
>> Did you tried running the drivers on board or are there any special
>> preparation needed?
>> I've BeagleBoard-xM Rev. C applied your patches and enabled the
>> functions the in menuconfig.
>> But on dmesg I see that:
>>
>> [    0.685028] of_amba_device_create(): amba_device_add() failed (-19)
>> for /etb@5401b000
>> [    0.685119] of_amba_device_create(): amba_device_add() failed (-19)
>> for /etm@54010000
>>
>> There are no nodes according coresight in /sys/kernel/debug/ .
> Right, that is because there is a problem in mainline with enabling
> "emu_src_ck".  The call to "clk_prepare_enable()" returns without
> waiting for the clock to effectively be enabled, preventing the
> components from being discovered properly.
>
> The work around (non-upstreamable) is to have a driver getting a hold
> of the clock before AMBA devices are probed.  I can send you that code
> (10 lines) if need be.
Ok I can confirm that this patch works fine for BeagleBoard-xM. After
applying workaround for that clock the devices are properly discovered
and visible through sysfs entries.

Thanks,
Marcin
>
>> Best regards,
>> Marcin
>>
>>> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
>>> ---
>>>  arch/arm/boot/dts/omap3-beagle-xm.dts | 28 ++++++++++++++++++++++++++++
>>>  arch/arm/boot/dts/omap3-beagle.dts    | 28 ++++++++++++++++++++++++++++
>>>  2 files changed, 56 insertions(+)
>>>
>>> diff --git a/arch/arm/boot/dts/omap3-beagle-xm.dts b/arch/arm/boot/dts/omap3-beagle-xm.dts
>>> index 1becefc..eec73d8 100644
>>> --- a/arch/arm/boot/dts/omap3-beagle-xm.dts
>>> +++ b/arch/arm/boot/dts/omap3-beagle-xm.dts
>>> @@ -145,6 +145,34 @@
>>>                       };
>>>               };
>>>       };
>>> +
>>> +     etb@5401b000 {
>>> +             compatible = "arm,coresight-etb10", "arm,primecell";
>>> +             reg = <0x5401b000 0x1000>;
>>> +
>>> +             coresight-default-sink;
>>> +             clocks = <&emu_src_ck>;
>>> +             clock-names = "apb_pclk";
>>> +             port {
>>> +                     etb_in: endpoint {
>>> +                             slave-mode;
>>> +                             remote-endpoint = <&etm_out>;
>>> +                     };
>>> +             };
>>> +     };
>>> +
>>> +     etm@54010000 {
>>> +             compatible = "arm,coresight-etm3x", "arm,primecell";
>>> +             reg = <0x54010000 0x1000>;
>>> +
>>> +             clocks = <&emu_src_ck>;
>>> +             clock-names = "apb_pclk";
>>> +             port {
>>> +                     etm_out: endpoint {
>>> +                             remote-endpoint = <&etb_in>;
>>> +                     };
>>> +             };
>>> +     };
>>>  };
>>>
>>>  &omap3_pmx_wkup {
>>> diff --git a/arch/arm/boot/dts/omap3-beagle.dts b/arch/arm/boot/dts/omap3-beagle.dts
>>> index 3c3e6da..a151daf 100644
>>> --- a/arch/arm/boot/dts/omap3-beagle.dts
>>> +++ b/arch/arm/boot/dts/omap3-beagle.dts
>>> @@ -140,6 +140,34 @@
>>>                       };
>>>               };
>>>       };
>>> +
>>> +     etb@540000000 {
>>> +             compatible = "arm,coresight-etb10", "arm,primecell";
>>> +             reg = <0x5401b000 0x1000>;
>>> +
>>> +             coresight-default-sink;
>>> +             clocks = <&emu_src_ck>;
>>> +             clock-names = "apb_pclk";
>>> +             port {
>>> +                     etb_in: endpoint {
>>> +                             slave-mode;
>>> +                             remote-endpoint = <&etm_out>;
>>> +                     };
>>> +             };
>>> +     };
>>> +
>>> +     etm@54010000 {
>>> +             compatible = "arm,coresight-etm3x", "arm,primecell";
>>> +             reg = <0x54010000 0x1000>;
>>> +
>>> +             clocks = <&emu_src_ck>;
>>> +             clock-names = "apb_pclk";
>>> +             port {
>>> +                     etm_out: endpoint {
>>> +                             remote-endpoint = <&etb_in>;
>>> +                     };
>>> +             };
>>> +     };
>>>  };
>>>
>>>  &omap3_pmx_wkup {
diff mbox

Patch

diff --git a/arch/arm/boot/dts/omap3-beagle-xm.dts b/arch/arm/boot/dts/omap3-beagle-xm.dts
index 1becefc..eec73d8 100644
--- a/arch/arm/boot/dts/omap3-beagle-xm.dts
+++ b/arch/arm/boot/dts/omap3-beagle-xm.dts
@@ -145,6 +145,34 @@ 
 			};
 		};
 	};
+
+	etb@5401b000 {
+		compatible = "arm,coresight-etb10", "arm,primecell";
+		reg = <0x5401b000 0x1000>;
+
+		coresight-default-sink;
+		clocks = <&emu_src_ck>;
+		clock-names = "apb_pclk";
+		port {
+			etb_in: endpoint {
+				slave-mode;
+				remote-endpoint = <&etm_out>;
+			};
+		};
+	};
+
+	etm@54010000 {
+		compatible = "arm,coresight-etm3x", "arm,primecell";
+		reg = <0x54010000 0x1000>;
+
+		clocks = <&emu_src_ck>;
+		clock-names = "apb_pclk";
+		port {
+			etm_out: endpoint {
+				remote-endpoint = <&etb_in>;
+			};
+		};
+	};
 };
 
 &omap3_pmx_wkup {
diff --git a/arch/arm/boot/dts/omap3-beagle.dts b/arch/arm/boot/dts/omap3-beagle.dts
index 3c3e6da..a151daf 100644
--- a/arch/arm/boot/dts/omap3-beagle.dts
+++ b/arch/arm/boot/dts/omap3-beagle.dts
@@ -140,6 +140,34 @@ 
 			};
 		};
 	};
+
+	etb@540000000 {
+		compatible = "arm,coresight-etb10", "arm,primecell";
+		reg = <0x5401b000 0x1000>;
+
+		coresight-default-sink;
+		clocks = <&emu_src_ck>;
+		clock-names = "apb_pclk";
+		port {
+			etb_in: endpoint {
+				slave-mode;
+				remote-endpoint = <&etm_out>;
+			};
+		};
+	};
+
+	etm@54010000 {
+		compatible = "arm,coresight-etm3x", "arm,primecell";
+		reg = <0x54010000 0x1000>;
+
+		clocks = <&emu_src_ck>;
+		clock-names = "apb_pclk";
+		port {
+			etm_out: endpoint {
+				remote-endpoint = <&etb_in>;
+			};
+		};
+	};
 };
 
 &omap3_pmx_wkup {