diff mbox series

[v2] coresight: etm4x: Add Support for HiSilicon ETM device

Message ID 1597323562-3706-1-git-send-email-liuqi115@huawei.com (mailing list archive)
State New, archived
Headers show
Series [v2] coresight: etm4x: Add Support for HiSilicon ETM device | expand

Commit Message

liuqi (BA) Aug. 13, 2020, 12:59 p.m. UTC
Add ETMv4 periperhal ID for HiSilicon Hip08 and Hip09 platform. Hip08
contains ETMv4.2 device and Hip09 contains ETMv4.5 device.

Signed-off-by: Qi Liu <liuqi115@huawei.com>
---
 drivers/hwtracing/coresight/coresight-etm4x.c | 2 ++
 1 file changed, 2 insertions(+)

--
2.8.1

Comments

Suzuki K Poulose Aug. 13, 2020, 1:44 p.m. UTC | #1
On 08/13/2020 01:59 PM, Qi Liu wrote:
> Add ETMv4 periperhal ID for HiSilicon Hip08 and Hip09 platform. Hip08
> contains ETMv4.2 device and Hip09 contains ETMv4.5 device.
> 
> Signed-off-by: Qi Liu <liuqi115@huawei.com>
> ---
>   drivers/hwtracing/coresight/coresight-etm4x.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/hwtracing/coresight/coresight-etm4x.c b/drivers/hwtracing/coresight/coresight-etm4x.c
> index 6d7d216..7797a57 100644
> --- a/drivers/hwtracing/coresight/coresight-etm4x.c
> +++ b/drivers/hwtracing/coresight/coresight-etm4x.c
> @@ -1587,6 +1587,8 @@ static const struct amba_id etm4_ids[] = {
>   	CS_AMBA_UCI_ID(0x000bb805, uci_id_etm4),/* Qualcomm Kryo 4XX Cortex-A55 */
>   	CS_AMBA_UCI_ID(0x000bb804, uci_id_etm4),/* Qualcomm Kryo 4XX Cortex-A76 */
>   	CS_AMBA_UCI_ID(0x000cc0af, uci_id_etm4),/* Marvell ThunderX2 */
> +	CS_AMBA_UCI_ID(0x000b6d01, uci_id_etm4),/* HiSilicon-Hip08 */
> +	CS_AMBA_UCI_ID(0x000b6d02, uci_id_etm4),/* HiSilicon-Hip09 */

Acked-by: Suzuki K Poulose <suzuki.oulose@arm.com>
Mathieu Poirier Aug. 13, 2020, 9 p.m. UTC | #2
On Thu, Aug 13, 2020 at 08:59:22PM +0800, Qi Liu wrote:
> Add ETMv4 periperhal ID for HiSilicon Hip08 and Hip09 platform. Hip08
> contains ETMv4.2 device and Hip09 contains ETMv4.5 device.
> 
> Signed-off-by: Qi Liu <liuqi115@huawei.com>

I have applied your patch to my local branch - it will be published on Monday
with the release of the v5.9-rc1 kernel.

Thanks,
Mathieu

> ---
>  drivers/hwtracing/coresight/coresight-etm4x.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/hwtracing/coresight/coresight-etm4x.c b/drivers/hwtracing/coresight/coresight-etm4x.c
> index 6d7d216..7797a57 100644
> --- a/drivers/hwtracing/coresight/coresight-etm4x.c
> +++ b/drivers/hwtracing/coresight/coresight-etm4x.c
> @@ -1587,6 +1587,8 @@ static const struct amba_id etm4_ids[] = {
>  	CS_AMBA_UCI_ID(0x000bb805, uci_id_etm4),/* Qualcomm Kryo 4XX Cortex-A55 */
>  	CS_AMBA_UCI_ID(0x000bb804, uci_id_etm4),/* Qualcomm Kryo 4XX Cortex-A76 */
>  	CS_AMBA_UCI_ID(0x000cc0af, uci_id_etm4),/* Marvell ThunderX2 */
> +	CS_AMBA_UCI_ID(0x000b6d01, uci_id_etm4),/* HiSilicon-Hip08 */
> +	CS_AMBA_UCI_ID(0x000b6d02, uci_id_etm4),/* HiSilicon-Hip09 */
>  	{},
>  };
> 
> --
> 2.8.1
>
Alexei Budankov May 25, 2022, 3:10 p.m. UTC | #3
Hi Qi Liu,

On 13.08.2020 15:59, Qi Liu wrote:
> Add ETMv4 periperhal ID for HiSilicon Hip08 and Hip09 platform. Hip08
> contains ETMv4.2 device and Hip09 contains ETMv4.5 device.
> 
> Signed-off-by: Qi Liu <liuqi115@huawei.com>
> ---
>   drivers/hwtracing/coresight/coresight-etm4x.c | 2 ++
>   1 file changed, 2 insertions(+)

Thanks for your patch.
I would like to test HiSilicon ETM device feature on
Kunpeng 920 based server.
I applied the patch and booted the kernel with the changes.
However I don't see any device files neither here:
/sys/bus/coresight/devices/
nor here:
/sys/bus/event_source/devices/cs_etm/sinks/
What should a user expect new in os with this patch added?

Thanks,
Alexei


> 
> diff --git a/drivers/hwtracing/coresight/coresight-etm4x.c b/drivers/hwtracing/coresight/coresight-etm4x.c
> index 6d7d216..7797a57 100644
> --- a/drivers/hwtracing/coresight/coresight-etm4x.c
> +++ b/drivers/hwtracing/coresight/coresight-etm4x.c
> @@ -1587,6 +1587,8 @@ static const struct amba_id etm4_ids[] = {
>   	CS_AMBA_UCI_ID(0x000bb805, uci_id_etm4),/* Qualcomm Kryo 4XX Cortex-A55 */
>   	CS_AMBA_UCI_ID(0x000bb804, uci_id_etm4),/* Qualcomm Kryo 4XX Cortex-A76 */
>   	CS_AMBA_UCI_ID(0x000cc0af, uci_id_etm4),/* Marvell ThunderX2 */
> +	CS_AMBA_UCI_ID(0x000b6d01, uci_id_etm4),/* HiSilicon-Hip08 */
> +	CS_AMBA_UCI_ID(0x000b6d02, uci_id_etm4),/* HiSilicon-Hip09 */
>   	{},
>   };
> 
> --
> 2.8.1
liuqi (BA) May 26, 2022, 2:56 a.m. UTC | #4
Hi Alexei,

On 2022/5/25 23:10, Alexei Budankov wrote:
> 
> Hi Qi Liu,
> 
> On 13.08.2020 15:59, Qi Liu wrote:
>> Add ETMv4 periperhal ID for HiSilicon Hip08 and Hip09 platform. Hip08
>> contains ETMv4.2 device and Hip09 contains ETMv4.5 device.
>>
>> Signed-off-by: Qi Liu <liuqi115@huawei.com>
>> ---
>>   drivers/hwtracing/coresight/coresight-etm4x.c | 2 ++
>>   1 file changed, 2 insertions(+)
> 
> Thanks for your patch.
> I would like to test HiSilicon ETM device feature on
> Kunpeng 920 based server.
> I applied the patch and booted the kernel with the changes.
> However I don't see any device files neither here:
> /sys/bus/coresight/devices/

Thanks for your test :)

Kunpeng 920 platform(Non-PG) support tracing CPU instruction, source 
device is coresight ETM, link device is coresight funnel and sink device 
is ultrasoc SMB. So you need to insmod coresight-* driver and SMB 
driver, which patch is :
Add support for UltraSoc System Memory Buffer
https://lore.kernel.org/linux-arm-kernel/20220416083953.52610-1-liuqi115@huawei.com/

by the way, can you help to check /sys/bus/amba/devices/, and make sure 
that the firmware of your board has supported ETM, funnel and SMB devices?

Thanks,
Qi

> nor here:
> /sys/bus/event_source/devices/cs_etm/sinks/
> What should a user expect new in os with this patch added?


> 
> Thanks,
> Alexei
> 


> 
>>
>> diff --git a/drivers/hwtracing/coresight/coresight-etm4x.c 
>> b/drivers/hwtracing/coresight/coresight-etm4x.c
>> index 6d7d216..7797a57 100644
>> --- a/drivers/hwtracing/coresight/coresight-etm4x.c
>> +++ b/drivers/hwtracing/coresight/coresight-etm4x.c
>> @@ -1587,6 +1587,8 @@ static const struct amba_id etm4_ids[] = {
>>       CS_AMBA_UCI_ID(0x000bb805, uci_id_etm4),/* Qualcomm Kryo 4XX 
>> Cortex-A55 */
>>       CS_AMBA_UCI_ID(0x000bb804, uci_id_etm4),/* Qualcomm Kryo 4XX 
>> Cortex-A76 */
>>       CS_AMBA_UCI_ID(0x000cc0af, uci_id_etm4),/* Marvell ThunderX2 */
>> +    CS_AMBA_UCI_ID(0x000b6d01, uci_id_etm4),/* HiSilicon-Hip08 */
>> +    CS_AMBA_UCI_ID(0x000b6d02, uci_id_etm4),/* HiSilicon-Hip09 */
>>       {},
>>   };
>>
>> -- 
>> 2.8.1
> .
Alexei Budankov May 26, 2022, 7:23 a.m. UTC | #5
Hi Qi,

On 26.05.2022 5:56, liuqi (BA) wrote:
> 
> Hi Alexei,
> 
> On 2022/5/25 23:10, Alexei Budankov wrote:
>>
>> Hi Qi Liu,
>>
>> On 13.08.2020 15:59, Qi Liu wrote:
>>> Add ETMv4 periperhal ID for HiSilicon Hip08 and Hip09 platform. Hip08
>>> contains ETMv4.2 device and Hip09 contains ETMv4.5 device.
>>>
>>> Signed-off-by: Qi Liu <liuqi115@huawei.com>
>>> ---
>>>   drivers/hwtracing/coresight/coresight-etm4x.c | 2 ++
>>>   1 file changed, 2 insertions(+)
>>
>> Thanks for your patch.
>> I would like to test HiSilicon ETM device feature on
>> Kunpeng 920 based server.
>> I applied the patch and booted the kernel with the changes.
>> However I don't see any device files neither here:
>> /sys/bus/coresight/devices/
> 
> Thanks for your test :)

Thanks for quick reply. Appreciate it much. :)

> 
> Kunpeng 920 platform(Non-PG) support tracing CPU instruction, source device is coresight ETM, link device is coresight funnel and sink device is ultrasoc SMB. So you need to insmod coresight-* driver and SMB driver, which patch is :
> Add support for UltraSoc System Memory Buffer
> https://lore.kernel.org/linux-arm-kernel/20220416083953.52610-1-liuqi115@huawei.com/

I will try it shortly and let you know.

> 
> by the way, can you help to check /sys/bus/amba/devices/, and make sure that the firmware of your board has supported ETM, funnel and SMB devices?

Here we go:

huawei@armubuntu:~$ pwd
/home/huawei
huawei@armubuntu:~$ ls /sys/bus/amba/devices/
huawei@armubuntu:~$ 

Look like our server firmware should be upgraded, right?
Your help and support is greatly appreciated.

Thanks,
Alexei

> 
> Thanks,
> Qi
> 
>> nor here:
>> /sys/bus/event_source/devices/cs_etm/sinks/
>> What should a user expect new in os with this patch added?
> 
> 
>>
>> Thanks,
>> Alexei
>>
> 
> 
>>
>>>
>>> diff --git a/drivers/hwtracing/coresight/coresight-etm4x.c b/drivers/hwtracing/coresight/coresight-etm4x.c
>>> index 6d7d216..7797a57 100644
>>> --- a/drivers/hwtracing/coresight/coresight-etm4x.c
>>> +++ b/drivers/hwtracing/coresight/coresight-etm4x.c
>>> @@ -1587,6 +1587,8 @@ static const struct amba_id etm4_ids[] = {
>>>       CS_AMBA_UCI_ID(0x000bb805, uci_id_etm4),/* Qualcomm Kryo 4XX Cortex-A55 */
>>>       CS_AMBA_UCI_ID(0x000bb804, uci_id_etm4),/* Qualcomm Kryo 4XX Cortex-A76 */
>>>       CS_AMBA_UCI_ID(0x000cc0af, uci_id_etm4),/* Marvell ThunderX2 */
>>> +    CS_AMBA_UCI_ID(0x000b6d01, uci_id_etm4),/* HiSilicon-Hip08 */
>>> +    CS_AMBA_UCI_ID(0x000b6d02, uci_id_etm4),/* HiSilicon-Hip09 */
>>>       {},
>>>   };
>>>
>>> -- 
>>> 2.8.1
>> .
> .
liuqi (BA) May 26, 2022, 7:47 a.m. UTC | #6
On 2022/5/26 15:23, Alexei Budankov wrote:
> Hi Qi,
> 
> On 26.05.2022 5:56, liuqi (BA) wrote:
>>
>> Hi Alexei,
>>
>> On 2022/5/25 23:10, Alexei Budankov wrote:
>>>
>>> Hi Qi Liu,
>>>
>>> On 13.08.2020 15:59, Qi Liu wrote:
>>>> Add ETMv4 periperhal ID for HiSilicon Hip08 and Hip09 platform. Hip08
>>>> contains ETMv4.2 device and Hip09 contains ETMv4.5 device.
>>>>
>>>> Signed-off-by: Qi Liu <liuqi115@huawei.com>
>>>> ---
>>>>    drivers/hwtracing/coresight/coresight-etm4x.c | 2 ++
>>>>    1 file changed, 2 insertions(+)
>>>
>>> Thanks for your patch.
>>> I would like to test HiSilicon ETM device feature on
>>> Kunpeng 920 based server.
>>> I applied the patch and booted the kernel with the changes.
>>> However I don't see any device files neither here:
>>> /sys/bus/coresight/devices/
>>
>> Thanks for your test :)
> 
> Thanks for quick reply. Appreciate it much. :)
> 
>>
>> Kunpeng 920 platform(Non-PG) support tracing CPU instruction, source device is coresight ETM, link device is coresight funnel and sink device is ultrasoc SMB. So you need to insmod coresight-* driver and SMB driver, which patch is :
>> Add support for UltraSoc System Memory Buffer
>> https://lore.kernel.org/linux-arm-kernel/20220416083953.52610-1-liuqi115@huawei.com/
> 
> I will try it shortly and let you know.
> 
>>
>> by the way, can you help to check /sys/bus/amba/devices/, and make sure that the firmware of your board has supported ETM, funnel and SMB devices?
> 
> Here we go:
> 
> huawei@armubuntu:~$ pwd
> /home/huawei
> huawei@armubuntu:~$ ls /sys/bus/amba/devices/
> huawei@armubuntu:~$
> 
> Look like our server firmware should be upgraded, right?

Yes, seems firmware should be upgraded first, and then you could test 
ETM device :)

Best regards,
Qi
> Your help and support is greatly appreciated.
> > Thanks,
> Alexei
> 
>>
>> Thanks,
>> Qi
>>
>>> nor here:
>>> /sys/bus/event_source/devices/cs_etm/sinks/
>>> What should a user expect new in os with this patch added?
>>
>>
>>>
>>> Thanks,
>>> Alexei
>>>
>>
>>
>>>
>>>>
>>>> diff --git a/drivers/hwtracing/coresight/coresight-etm4x.c b/drivers/hwtracing/coresight/coresight-etm4x.c
>>>> index 6d7d216..7797a57 100644
>>>> --- a/drivers/hwtracing/coresight/coresight-etm4x.c
>>>> +++ b/drivers/hwtracing/coresight/coresight-etm4x.c
>>>> @@ -1587,6 +1587,8 @@ static const struct amba_id etm4_ids[] = {
>>>>        CS_AMBA_UCI_ID(0x000bb805, uci_id_etm4),/* Qualcomm Kryo 4XX Cortex-A55 */
>>>>        CS_AMBA_UCI_ID(0x000bb804, uci_id_etm4),/* Qualcomm Kryo 4XX Cortex-A76 */
>>>>        CS_AMBA_UCI_ID(0x000cc0af, uci_id_etm4),/* Marvell ThunderX2 */
>>>> +    CS_AMBA_UCI_ID(0x000b6d01, uci_id_etm4),/* HiSilicon-Hip08 */
>>>> +    CS_AMBA_UCI_ID(0x000b6d02, uci_id_etm4),/* HiSilicon-Hip09 */
>>>>        {},
>>>>    };
>>>>
>>>> -- 
>>>> 2.8.1
>>> .
>> .
> .
>
Alexei Budankov May 26, 2022, 8 a.m. UTC | #7
Hi,

On 26.05.2022 10:47, liuqi (BA) wrote:
> 
> 
> On 2022/5/26 15:23, Alexei Budankov wrote:
>> Hi Qi,
>>
<SNIP>
>>
>> Look like our server firmware should be upgraded, right?
> 
> Yes, seems firmware should be upgraded first, and then you could test ETM device :)

I would appreciate if you could share some links to upgrade bits and docs, if possible,
so we could use it to perform the upgrade.

Thanks,
Alexei
Suzuki K Poulose May 26, 2022, 9:59 a.m. UTC | #8
Hi



On 26/05/2022 09:00, Alexei Budankov wrote:
> Hi,
> 
> On 26.05.2022 10:47, liuqi (BA) wrote:
>>
>>
>> On 2022/5/26 15:23, Alexei Budankov wrote:
>>> Hi Qi,
>>>
> <SNIP>
>>>
>>> Look like our server firmware should be upgraded, right?
>>
>> Yes, seems firmware should be upgraded first, and then you could test ETM device :)
> 
> I would appreciate if you could share some links to upgrade bits and docs, if possible,
> so we could use it to perform the upgrade.

Does your system use ACPI based firmware ? If that is
the case, we do not have the support for ETM with system instructions
at the moment. Anshuman is currently working on addressing
this.

Cheers
Suzuki

> 
> Thanks, > Alexei
>
Alexei Budankov May 26, 2022, 11:43 a.m. UTC | #9
Hi Suzuki,

On 26.05.2022 12:59, Suzuki K Poulose wrote:
> Hi
> 
> 
> 
> On 26/05/2022 09:00, Alexei Budankov wrote:
>> Hi,
>>
>> On 26.05.2022 10:47, liuqi (BA) wrote:
>>>
>>>
>>> On 2022/5/26 15:23, Alexei Budankov wrote:
>>>> Hi Qi,
>>>>
>> <SNIP>
>>>>
>>>> Look like our server firmware should be upgraded, right?
>>>
>>> Yes, seems firmware should be upgraded first, and then you could test ETM device :)
>>
>> I would appreciate if you could share some links to upgrade bits and docs, if possible,
>> so we could use it to perform the upgrade.
> 
> Does your system use ACPI based firmware ? If that is

Not sure about it yet.

> the case, we do not have the support for ETM with system instructions
> at the moment. Anshuman is currently working on addressing
> this.

Thanks for clarification. Good to know.

Thanks,
Alexei

> 
> Cheers
> Suzuki
> 
>>
>> Thanks, > Alexei
>>
> 
> .
diff mbox series

Patch

diff --git a/drivers/hwtracing/coresight/coresight-etm4x.c b/drivers/hwtracing/coresight/coresight-etm4x.c
index 6d7d216..7797a57 100644
--- a/drivers/hwtracing/coresight/coresight-etm4x.c
+++ b/drivers/hwtracing/coresight/coresight-etm4x.c
@@ -1587,6 +1587,8 @@  static const struct amba_id etm4_ids[] = {
 	CS_AMBA_UCI_ID(0x000bb805, uci_id_etm4),/* Qualcomm Kryo 4XX Cortex-A55 */
 	CS_AMBA_UCI_ID(0x000bb804, uci_id_etm4),/* Qualcomm Kryo 4XX Cortex-A76 */
 	CS_AMBA_UCI_ID(0x000cc0af, uci_id_etm4),/* Marvell ThunderX2 */
+	CS_AMBA_UCI_ID(0x000b6d01, uci_id_etm4),/* HiSilicon-Hip08 */
+	CS_AMBA_UCI_ID(0x000b6d02, uci_id_etm4),/* HiSilicon-Hip09 */
 	{},
 };