Hi Suzuki & Mike & James,
We have new CTI HW component called Qcom Extended CTI.
The main difference of extended CTI to the normal CTI is that the address mapping is changed and it supports a max of 128 trigger signals.
For the changes to CTI driver, I want to define the address mapping like below.
Could you please help to provide your comments how can we make the changes to the different address mappings of Qcom extended CTI ?
/* CTI programming registers */ +#define CTIINTACK(drvdata, n) ((drvdata->is_extended ? 0x020 : 0x010) + (4 * n)) +#define CTIAPPSET(drvdata) (drvdata->is_extended ? 0x004 : 0x014) +#define CTIAPPCLEAR(drvdata) (drvdata->is_extended ? 0x008 : 0x018) +#define CTIAPPPULSE(drvdata) (drvdata->is_extended ? 0x00C : 0x01C) +#define CTIINEN(drvdata, n) ((drvdata->is_extended ? 0x400 : 0x020) + (4 * n)) +#define CTIOUTEN(drvdata, n) ((drvdata->is_extended ? 0x800 : 0x0A0) + (4 * n)) +#define CTITRIGINSTATUS(drvdata, n) ((drvdata->is_extended ? 0x040 : 0x130) + (4 * n)) +#define CTITRIGOUTSTATUS(drvdata, n) ((drvdata->is_extended ? 0x060 : 0x134) + (4 * n)) +#define CTICHINSTATUS(drvdata) (drvdata->is_extended ? 0x080 : 0x138) +#define CTICHOUTSTATUS(drvdata) (drvdata->is_extended ? 0x084 : 0x13C) +#define CTIGATE(drvdata) (drvdata->is_extended ? 0x088 : 0x140) +#define ASICCTL(drvdata) (drvdata->is_extended ? 0x08C : 0x144) /* Integration test registers */ +#define ITCHINACK(drvdata) (drvdata->is_extended ? 0xE70 : 0xEDC) /* WO CTI CSSoc 400 only*/ +#define ITTRIGINACK(drvdata, n) ((drvdata->is_extended ? 0xE80 : 0xEE0) + (4 * n)) /* WO CTI CSSoc 400 only*/ +#define ITCHOUT(drvdata) (drvdata->is_extended ? 0xE74 : 0xEE4) /* WO RW-600 */ +#define ITTRIGOUT(drvdata, n) ((drvdata->is_extended ? 0xEA : 0xEE8) + (4 * n)) /* WO RW-600 */ +#define ITCHOUTACK(drvdata) (drvdata->is_extended ? 0xE78 : 0xEEC) /* RO CTI CSSoc 400 only*/ +#define ITTRIGOUTACK(drvdata, n) ((drvdata->is_extended ? 0xEC0 : 0xEF0) + (4 * n))/* RO CTI CSSoc 400 only*/ +#define ITCHIN(drvdata) (drvdata->is_extended ? 0xE7C : 0xEF4) /* RO */ +#define ITTRIGIN(drvdata, n) ((drvdata->is_extended ? 0xEE0 : 0xEF8) + (4 * n))/* RO */
Thanks Jinlong Mao
Hi Jinlong,
This will create a huge amount of changes in the CTI driver code, plus the macros are also permitted to be used in a non-driver context - e,g, userspace code, configuration tables, where drvdata will not be present.
I suggest a conditional define to bracket new addresses and standard addresses
e.g.
#ifdef QCOM_EXTENDED_CTI ... #define CTIGATE 0x88 ... #else ... #define CTIGATE 0x140 ... #endif
This can be controlled by a CONFIG macro in KConfig - and the driver compatible and name need to be different from a standard CTI. This will allow the qcom-cti driver to reuse some of the coresight-cti driver code Essentailly if the mapping has changed then this is a different device.
Regards
Mike
.
On Tue, 20 Aug 2024 at 07:19, Jinlong Mao quic_jinlmao@quicinc.com wrote:
Hi Suzuki & Mike & James,
We have new CTI HW component called Qcom Extended CTI.
The main difference of extended CTI to the normal CTI is that the address mapping is changed and it supports a max of 128 trigger signals.
For the changes to CTI driver, I want to define the address mapping like below.
Could you please help to provide your comments how can we make the changes to the different address mappings of Qcom extended CTI ?
/* CTI programming registers */ +#define CTIINTACK(drvdata, n) ((drvdata->is_extended ? 0x020 : 0x010)
- (4 * n))
+#define CTIAPPSET(drvdata) (drvdata->is_extended ? 0x004 : 0x014) +#define CTIAPPCLEAR(drvdata) (drvdata->is_extended ? 0x008 : 0x018) +#define CTIAPPPULSE(drvdata) (drvdata->is_extended ? 0x00C : 0x01C) +#define CTIINEN(drvdata, n) ((drvdata->is_extended ? 0x400 : 0x020)
- (4 * n))
+#define CTIOUTEN(drvdata, n) ((drvdata->is_extended ? 0x800 : 0x0A0)
- (4 * n))
+#define CTITRIGINSTATUS(drvdata, n) ((drvdata->is_extended ? 0x040 : 0x130) + (4 * n)) +#define CTITRIGOUTSTATUS(drvdata, n) ((drvdata->is_extended ? 0x060 : 0x134) + (4 * n)) +#define CTICHINSTATUS(drvdata) (drvdata->is_extended ? 0x080 : 0x138) +#define CTICHOUTSTATUS(drvdata) (drvdata->is_extended ? 0x084 : 0x13C) +#define CTIGATE(drvdata) (drvdata->is_extended ? 0x088 : 0x140) +#define ASICCTL(drvdata) (drvdata->is_extended ? 0x08C : 0x144) /* Integration test registers */ +#define ITCHINACK(drvdata) (drvdata->is_extended ? 0xE70 : 0xEDC) /* WO CTI CSSoc 400 only*/ +#define ITTRIGINACK(drvdata, n) ((drvdata->is_extended ? 0xE80 : 0xEE0) + (4 * n)) /* WO CTI CSSoc 400 only*/ +#define ITCHOUT(drvdata) (drvdata->is_extended ? 0xE74 : 0xEE4) /* WO RW-600 */ +#define ITTRIGOUT(drvdata, n) ((drvdata->is_extended ? 0xEA : 0xEE8) + (4 * n)) /* WO RW-600 */ +#define ITCHOUTACK(drvdata) (drvdata->is_extended ? 0xE78 : 0xEEC) /* RO CTI CSSoc 400 only*/ +#define ITTRIGOUTACK(drvdata, n) ((drvdata->is_extended ? 0xEC0 : 0xEF0) + (4 * n))/* RO CTI CSSoc 400 only*/ +#define ITCHIN(drvdata) (drvdata->is_extended ? 0xE7C : 0xEF4) /* RO */ +#define ITTRIGIN(drvdata, n) ((drvdata->is_extended ? 0xEE0 : 0xEF8)
- (4 * n))/* RO */
Thanks Jinlong Mao
On 2024/8/30 23:14, Mike Leach wrote:
Hi Jinlong,
This will create a huge amount of changes in the CTI driver code, plus the macros are also permitted to be used in a non-driver context - e,g, userspace code, configuration tables, where drvdata will not be present.
I suggest a conditional define to bracket new addresses and standard addresses
e.g.
#ifdef QCOM_EXTENDED_CTI ... #define CTIGATE 0x88 ... #else ... #define CTIGATE 0x140 ... #endif
This can be controlled by a CONFIG macro in KConfig - and the driver compatible and name need to be different from a standard CTI. This will allow the qcom-cti driver to reuse some of the coresight-cti driver code Essentailly if the mapping has changed then this is a different device.
Regards
Mike
Hi Mike,
Thanks for the reply.
On one soc, there will be both normal arm CTIs and QCOM extended CTIs.
As max trigger number becomes 128. So triger registers becomes 4.
Like CTITRIGINSTATUS --- > CTITRIGINSTATUS_EXTENDED(n) (0x040 + (4 * n)) n is 0 to 4.
Conditional define doesn't help.
Thanks Jinlong Mao
.
On Tue, 20 Aug 2024 at 07:19, Jinlong Mao quic_jinlmao@quicinc.com wrote:
Hi Suzuki & Mike & James,
We have new CTI HW component called Qcom Extended CTI.
The main difference of extended CTI to the normal CTI is that the address mapping is changed and it supports a max of 128 trigger signals.
For the changes to CTI driver, I want to define the address mapping like below.
Could you please help to provide your comments how can we make the changes to the different address mappings of Qcom extended CTI ?
/* CTI programming registers */ +#define CTIINTACK(drvdata, n) ((drvdata->is_extended ? 0x020 : 0x010)
- (4 * n))
+#define CTIAPPSET(drvdata) (drvdata->is_extended ? 0x004 : 0x014) +#define CTIAPPCLEAR(drvdata) (drvdata->is_extended ? 0x008 : 0x018) +#define CTIAPPPULSE(drvdata) (drvdata->is_extended ? 0x00C : 0x01C) +#define CTIINEN(drvdata, n) ((drvdata->is_extended ? 0x400 : 0x020)
- (4 * n))
+#define CTIOUTEN(drvdata, n) ((drvdata->is_extended ? 0x800 : 0x0A0)
- (4 * n))
+#define CTITRIGINSTATUS(drvdata, n) ((drvdata->is_extended ? 0x040 : 0x130) + (4 * n)) +#define CTITRIGOUTSTATUS(drvdata, n) ((drvdata->is_extended ? 0x060 : 0x134) + (4 * n)) +#define CTICHINSTATUS(drvdata) (drvdata->is_extended ? 0x080 : 0x138) +#define CTICHOUTSTATUS(drvdata) (drvdata->is_extended ? 0x084 : 0x13C) +#define CTIGATE(drvdata) (drvdata->is_extended ? 0x088 : 0x140) +#define ASICCTL(drvdata) (drvdata->is_extended ? 0x08C : 0x144) /* Integration test registers */ +#define ITCHINACK(drvdata) (drvdata->is_extended ? 0xE70 : 0xEDC) /* WO CTI CSSoc 400 only*/ +#define ITTRIGINACK(drvdata, n) ((drvdata->is_extended ? 0xE80 : 0xEE0) + (4 * n)) /* WO CTI CSSoc 400 only*/ +#define ITCHOUT(drvdata) (drvdata->is_extended ? 0xE74 : 0xEE4) /* WO RW-600 */ +#define ITTRIGOUT(drvdata, n) ((drvdata->is_extended ? 0xEA : 0xEE8) + (4 * n)) /* WO RW-600 */ +#define ITCHOUTACK(drvdata) (drvdata->is_extended ? 0xE78 : 0xEEC) /* RO CTI CSSoc 400 only*/ +#define ITTRIGOUTACK(drvdata, n) ((drvdata->is_extended ? 0xEC0 : 0xEF0) + (4 * n))/* RO CTI CSSoc 400 only*/ +#define ITCHIN(drvdata) (drvdata->is_extended ? 0xE7C : 0xEF4) /* RO */ +#define ITTRIGIN(drvdata, n) ((drvdata->is_extended ? 0xEE0 : 0xEF8)
- (4 * n))/* RO */
Thanks Jinlong Mao