From: Jon Hunter <jon-hunter-l0cyMroinI0@public.gmane.org>
To: Will Deacon <will.deacon-5wv7dgnIgG8@public.gmane.org>
Cc: Russell King <linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org>,
device-tree
<devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org>,
"rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org"
<rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org>,
Ming Lei <ming.lei-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>,
linux-omap <linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
Pratik Patel <pratikp-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
linux-arm
<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>
Subject: Re: [RFC 1/5] ARM: CORESIGHT: Add generic lock/unlock helpers
Date: Thu, 13 Dec 2012 13:18:43 -0600 [thread overview]
Message-ID: <50CA2A13.9090005@ti.com> (raw)
In-Reply-To: <20121213145803.GL26540-MRww78TxoiP5vMa5CHWGZ34zcgK1vI+I0E9HWUfgJXw@public.gmane.org>
On 12/13/2012 08:58 AM, Will Deacon wrote:
> Hi Jon,
>
> On Wed, Dec 12, 2012 at 09:43:04PM +0000, Jon Hunter wrote:
>> The Cross Trigger Interface (CTI) helpers in cti.h include definitions
>> for the Coresight Lock Access Register (LAR) and Lock Status Register
>> (LSR). These registers are already defined in coresight.h and so rather
>> than having multiple definitions, just use the definitions from
>> coresight.h.
>>
>> Add the following coresight macros ...
>> - coresight_unlock() --> Unlocks coresight module
>> - coresight_lock() --> Locks coresight module
>>
>> Use the above macros for ETB, ETM and CTI. The do-while(0) statement
>> has been removed from the macro as it is not a multi-line macro.
>>
>> Signed-off-by: Jon Hunter <jon-hunter-l0cyMroinI0@public.gmane.org>
>> ---
>> arch/arm/include/asm/cti.h | 16 +++-------------
>> arch/arm/include/asm/hardware/coresight.h | 16 ++++++++--------
>> 2 files changed, 11 insertions(+), 21 deletions(-)
>
> [...]
>
>> diff --git a/arch/arm/include/asm/hardware/coresight.h b/arch/arm/include/asm/hardware/coresight.h
>> index 7ecd793..dcd0e66 100644
>> --- a/arch/arm/include/asm/hardware/coresight.h
>> +++ b/arch/arm/include/asm/hardware/coresight.h
>> @@ -141,17 +141,17 @@
>> #define ETBFF_TRIGEVT BIT(9)
>> #define ETBFF_TRIGFL BIT(10)
>>
>> -#define etb_writel(t, v, x) \
>> - (__raw_writel((v), (t)->etb_regs + (x)))
>> +#define etb_writel(t, v, x) (__raw_writel((v), (t)->etb_regs + (x)))
>> #define etb_readl(t, x) (__raw_readl((t)->etb_regs + (x)))
>>
>> -#define etm_lock(t) do { etm_writel((t), 0, CSMR_LOCKACCESS); } while (0)
>> -#define etm_unlock(t) \
>> - do { etm_writel((t), UNLOCK_MAGIC, CSMR_LOCKACCESS); } while (0)
>> +#define etb_lock(t) coresight_lock((t)->etb_regs)
>> +#define etb_unlock(t) coresight_unlock((t)->etb_regs)
>> +#define etm_lock(t) coresight_lock((t)->etm_regs)
>> +#define etm_unlock(t) coresight_unlock((t)->etm_regs)
>>
>> -#define etb_lock(t) do { etb_writel((t), 0, CSMR_LOCKACCESS); } while (0)
>> -#define etb_unlock(t) \
>> - do { etb_writel((t), UNLOCK_MAGIC, CSMR_LOCKACCESS); } while (0)
>> +#define coresight_lock(base) (__raw_writel(0, base + CSMR_LOCKACCESS))
>> +#define coresight_unlock(base) \
>> + (__raw_writel(UNLOCK_MAGIC, base + CSMR_LOCKACCESS))
>>
>> #endif /* __ASM_HARDWARE_CORESIGHT_H */
>
> How about we take this opportunity to divorce the more general coresight
> bits from the etb specific parts, like you've done for the cti. We could
> move the ETB stuff out into asm/etb.h (although it might be nice to keep all
> the coresight device headers in one place... answers on a postcard) and just
> have the architected coresight functionality in this header.
Yes I have been wondering about that too. Long term it would be good to
find a home in the drivers directory for all these coresight devices
too. For now, we could extract the etb/etm parts from coresight.h into
etb.h and etm.h, respectively.
Cheers
Jon
WARNING: multiple messages have this Message-ID (diff)
From: jon-hunter@ti.com (Jon Hunter)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC 1/5] ARM: CORESIGHT: Add generic lock/unlock helpers
Date: Thu, 13 Dec 2012 13:18:43 -0600 [thread overview]
Message-ID: <50CA2A13.9090005@ti.com> (raw)
In-Reply-To: <20121213145803.GL26540@mudshark.cambridge.arm.com>
On 12/13/2012 08:58 AM, Will Deacon wrote:
> Hi Jon,
>
> On Wed, Dec 12, 2012 at 09:43:04PM +0000, Jon Hunter wrote:
>> The Cross Trigger Interface (CTI) helpers in cti.h include definitions
>> for the Coresight Lock Access Register (LAR) and Lock Status Register
>> (LSR). These registers are already defined in coresight.h and so rather
>> than having multiple definitions, just use the definitions from
>> coresight.h.
>>
>> Add the following coresight macros ...
>> - coresight_unlock() --> Unlocks coresight module
>> - coresight_lock() --> Locks coresight module
>>
>> Use the above macros for ETB, ETM and CTI. The do-while(0) statement
>> has been removed from the macro as it is not a multi-line macro.
>>
>> Signed-off-by: Jon Hunter <jon-hunter@ti.com>
>> ---
>> arch/arm/include/asm/cti.h | 16 +++-------------
>> arch/arm/include/asm/hardware/coresight.h | 16 ++++++++--------
>> 2 files changed, 11 insertions(+), 21 deletions(-)
>
> [...]
>
>> diff --git a/arch/arm/include/asm/hardware/coresight.h b/arch/arm/include/asm/hardware/coresight.h
>> index 7ecd793..dcd0e66 100644
>> --- a/arch/arm/include/asm/hardware/coresight.h
>> +++ b/arch/arm/include/asm/hardware/coresight.h
>> @@ -141,17 +141,17 @@
>> #define ETBFF_TRIGEVT BIT(9)
>> #define ETBFF_TRIGFL BIT(10)
>>
>> -#define etb_writel(t, v, x) \
>> - (__raw_writel((v), (t)->etb_regs + (x)))
>> +#define etb_writel(t, v, x) (__raw_writel((v), (t)->etb_regs + (x)))
>> #define etb_readl(t, x) (__raw_readl((t)->etb_regs + (x)))
>>
>> -#define etm_lock(t) do { etm_writel((t), 0, CSMR_LOCKACCESS); } while (0)
>> -#define etm_unlock(t) \
>> - do { etm_writel((t), UNLOCK_MAGIC, CSMR_LOCKACCESS); } while (0)
>> +#define etb_lock(t) coresight_lock((t)->etb_regs)
>> +#define etb_unlock(t) coresight_unlock((t)->etb_regs)
>> +#define etm_lock(t) coresight_lock((t)->etm_regs)
>> +#define etm_unlock(t) coresight_unlock((t)->etm_regs)
>>
>> -#define etb_lock(t) do { etb_writel((t), 0, CSMR_LOCKACCESS); } while (0)
>> -#define etb_unlock(t) \
>> - do { etb_writel((t), UNLOCK_MAGIC, CSMR_LOCKACCESS); } while (0)
>> +#define coresight_lock(base) (__raw_writel(0, base + CSMR_LOCKACCESS))
>> +#define coresight_unlock(base) \
>> + (__raw_writel(UNLOCK_MAGIC, base + CSMR_LOCKACCESS))
>>
>> #endif /* __ASM_HARDWARE_CORESIGHT_H */
>
> How about we take this opportunity to divorce the more general coresight
> bits from the etb specific parts, like you've done for the cti. We could
> move the ETB stuff out into asm/etb.h (although it might be nice to keep all
> the coresight device headers in one place... answers on a postcard) and just
> have the architected coresight functionality in this header.
Yes I have been wondering about that too. Long term it would be good to
find a home in the drivers directory for all these coresight devices
too. For now, we could extract the etb/etm parts from coresight.h into
etb.h and etm.h, respectively.
Cheers
Jon
next prev parent reply other threads:[~2012-12-13 19:18 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-12 21:43 [RFC 0/5] ARM: Add Cross Trigger Interface driver Jon Hunter
2012-12-12 21:43 ` Jon Hunter
2012-12-12 21:43 ` [RFC 2/5] ARM: dts: Add Cross Trigger Interface binding Jon Hunter
2012-12-12 21:43 ` Jon Hunter
2012-12-12 22:12 ` Rob Herring
2012-12-12 22:12 ` Rob Herring
2012-12-12 23:23 ` Jon Hunter
2012-12-12 23:23 ` Jon Hunter
2012-12-14 19:53 ` Rob Herring
2012-12-14 19:53 ` Rob Herring
2012-12-13 17:41 ` Will Deacon
2012-12-13 17:41 ` Will Deacon
2012-12-13 19:21 ` Jon Hunter
2012-12-13 19:21 ` Jon Hunter
2012-12-17 16:20 ` Mark Rutland
2012-12-17 16:20 ` Mark Rutland
2012-12-17 16:30 ` Jon Hunter
2012-12-17 16:30 ` Jon Hunter
2012-12-12 21:43 ` [RFC 3/5] ARM: CTI: Convert CTI helpers to AMBA bus driver Jon Hunter
2012-12-12 21:43 ` Jon Hunter
2012-12-13 15:08 ` Will Deacon
2012-12-13 15:08 ` Will Deacon
[not found] ` <20121213150826.GM26540-MRww78TxoiP5vMa5CHWGZ34zcgK1vI+I0E9HWUfgJXw@public.gmane.org>
2012-12-13 19:35 ` Jon Hunter
2012-12-13 19:35 ` Jon Hunter
2012-12-21 22:27 ` Pratik Patel
2012-12-21 22:27 ` Pratik Patel
2012-12-21 22:35 ` Pratik Patel
2012-12-21 22:35 ` Pratik Patel
2013-01-02 19:13 ` Jon Hunter
2013-01-02 19:13 ` Jon Hunter
2013-01-02 19:23 ` Jon Hunter
2013-01-02 19:23 ` Jon Hunter
2013-01-03 18:47 ` Pratik Patel
2013-01-03 18:47 ` Pratik Patel
[not found] ` <1355348588-22318-1-git-send-email-jon-hunter-l0cyMroinI0@public.gmane.org>
2012-12-12 21:43 ` [RFC 1/5] ARM: CORESIGHT: Add generic lock/unlock helpers Jon Hunter
2012-12-12 21:43 ` Jon Hunter
[not found] ` <1355348588-22318-2-git-send-email-jon-hunter-l0cyMroinI0@public.gmane.org>
2012-12-13 14:58 ` Will Deacon
2012-12-13 14:58 ` Will Deacon
[not found] ` <20121213145803.GL26540-MRww78TxoiP5vMa5CHWGZ34zcgK1vI+I0E9HWUfgJXw@public.gmane.org>
2012-12-13 19:18 ` Jon Hunter [this message]
2012-12-13 19:18 ` Jon Hunter
2012-12-13 19:36 ` Jean Pihet
2012-12-13 19:36 ` Jean Pihet
2012-12-12 21:43 ` [RFC 4/5] ARM: dts: OMAP4: Add CTI nodes Jon Hunter
2012-12-12 21:43 ` Jon Hunter
2012-12-12 21:43 ` [RFC 5/5] ARM: OMAP4: Add AMBA APB Clock Jon Hunter
2012-12-12 21:43 ` Jon Hunter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=50CA2A13.9090005@ti.com \
--to=jon-hunter-l0cymroini0@public.gmane.org \
--cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org \
--cc=linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=ming.lei-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org \
--cc=pratikp-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
--cc=rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org \
--cc=will.deacon-5wv7dgnIgG8@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.