Subject: [RFC PATCH] implement read_cpuid_ext for v7-M (Was: Re: [PATCHv2 2/3] ARM: Detect support for SDIV/UDIV from ISAR0) register

From: [email-masked] (Jonathan Austin)
Date: Tue, 07 May 2013 11:56:28 +0100

Hi Will,

On 07/05/13 10:22, Will Deacon wrote:
> On Mon, May 06, 2013 at 10:30:59AM +0100, Uwe Kleine-K?nig wrote:

>> +
>> +#define read_cpuid(reg)							\
>> +	({								\
>> +		WARN_ON_ONCE(1);					\
>> +		0;							\
>> +	})
>
> We do have an MIDR in PMSAv7 (not to be confused with MPIDR), so why not read
> that here?
We don't need to add/remove anything for PMSAv7 as that's already 
implemented...

For V7M we have something called CPUID Base Register, not MIDR - the 
layout looks the same though. That's the only one of the CPUID_X that we 
have, but it is never requested directly - only via read_cpuid_id (this 
is to support a hardcoded cpuid from kconfig) so what Uwe's got does 
work, though I agree that it'd be much nicer to implement the underlying 
function and have the accessor general for both AR and M.

Jonny