[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACRpkda6Rj0ZJ4NfKtqV=0p_OVEpjmSLNsUM7Z0MC3UMn43HGg@mail.gmail.com>
Date: Thu, 4 Sep 2014 19:31:02 +0200
From: Linus Walleij <linus.walleij@...aro.org>
To: Mathieu Poirier <mathieu.poirier@...aro.org>
Cc: Thomas Petazzoni <thomas.petazzoni@...e-electrons.com>,
Will Deacon <will.deacon@....com>,
Russell King - ARM Linux <linux@....linux.org.uk>,
Greg KH <gregkh@...uxfoundation.org>,
Arnd Bergmann <arnd@...aro.org>,
John Stultz <john.stultz@...aro.org>,
Pratik Patel <pratikp@...eaurora.org>,
Vikas Varshney <varshney@...com>, Al Grant <Al.Grant@....com>,
Jonas Svennebring <jonas.svennebring@...gotech.com>,
James King <james.king@...aro.org>,
Panchaxari Prasannamurthy Tumkur
<panchaxari.prasannamurthy@...aro.org>,
Kaixu Xia <kaixu.xia@...aro.org>,
Marcin Jabrzyk <marcin.jabrzyk@...il.com>,
"r.sengupta@...sung.com" <r.sengupta@...sung.com>,
Robert Marklund <robbelibobban@...il.com>,
Tony Armitstead <Tony.Armitstead@....com>,
Patch Tracking <patches@...aro.org>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 07/11 v5] coresight-etm: add CoreSight ETM/PTM driver
On Thu, Sep 4, 2014 at 7:19 PM, Mathieu Poirier
<mathieu.poirier@...aro.org> wrote:
> [Me]:
>> I would rewrite the last function like this:
>>
>> static inline unsigned int etm_readl(struct etm_drvdata *drvdata, u32 off)
>> {
>> u32 val;
>>
>> if (drvdata->use_cp14)
>> asm_volatile()...
>> else
>> val = readl_relaxed(drvdata->base + off);
>> return val;
>> }
>
> That unfortunately won't work. "u32 off" is a numerical value and it
> works well in the case were CP14 accesses aren't needed. On the flip
> side that numerical value isn't sufficient to deduce all 3 arguments
> (crn, crm, op2) required by instructions mcr/mrc for the right access
> to happen - there is simply no correlation between the offset of an
> APB bus memory mapped address and the corresponding CP14 access.
You're right, I oversimplified it in my head grossly...
Jens Wiklander pointed me to the macros used in OP-TEE for CP15
access with the same unpredictable patterns:
https://github.com/OP-TEE/optee_os/tree/master/core/arch/arm32/include
Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists