No subject
The AVP does not have a CP15.
As this thread speculates, it is an ARM7TDMI which is a basic ARM V4 core= =20with no ARM co-processors or MMU.
Also, ARM app note 99 (DAI0099C_core_type_rev_id.pdf) says the same thing= .
HTH,
Tom
Quoted 25 lines
-----Original Message-----
From: sjg at google.com [mailto:sjg at google.com] On Behalf Of Simon Glass
Sent: Monday, October 31, 2011 2:44 PM
To: Albert ARIBAUD
Cc: U-Boot Mailing List; Tom Warren; Stephen Warren
Subject: Re: [PATCH 3/9] arm: Move CP15 init out ofcpu_init_crit()=20
Hi Albert,
=20Quoted 14 lines · Albert ARIBAUD
Hi Simon,
Le 29/10/2011 02:36, Simon Glass a =E9crit :
Quoted 11 lines
Hi Albert,
Quoted 6 lines · On Thu, Oct 27, 2011 at 10:09 PM, Albert ARIBAUD <[email protected]>…
Le 28/10/2011 03:43, Simon Glass a =E9crit :
Quoted 3 lines
The test was
=A0 =A0 =A0 =A0mrc =A0 =A0 p15, 0, r0, c0, c0, 0 =A0 @ get ID regi=
ster
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
=A0 =A0 =A0 =A0and =A0 =A0 r0, r0, #0xf0000 =A0 =A0 =A0 =A0@ get a=
rchitecture
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
=A0 =A0 =A0 =A0cmp =A0 =A0 r0, #0xf0000 =A0 =A0 =A0 =A0 =A0 =A0@ c=
heck for> =A0 =A0ARMv6
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
=A0 =A0 =A0 =A0movne =A0 pc, lr =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
@ else skip cache init
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 4 lines
Quoted 2 lines
Unfortunately I think it is a plain ARM7TDMI with no CP15.
What about other fields in r0 right after mrc?
I don't really understand that sentence, sorry.
The ARM7TDMI does not have a CP15 and aborts if I try to access it. Just in case there is something odd going on I checked with DSTREAM =
/
Quoted 1 line
Quoted 1 line
Quoted 1 line
RVdebug and it definitely doesn't have a CP15. [as Ford Prefect woul=
d
Quoted 3 lines
Quoted 3 lines
Quoted 1 line
say, I counted them twice]
Ok, so debug tools do not show cp15. But tools can be tailored to wha=
t
Quoted 2 lines
tool
Quoted 1 line
makes think is needed -- I could tell about some debugging tools that=
=20will
Quoted 1 line
Quoted 1 line
not let me see all I want a core because the debug designers had fini=
te
Quoted 6 lines
Quoted 1 line
resources and what I wanted was not a priority to them.
=20
Ye of little faith...
=20Quoted 2 lines
OTOH, according to ARM, ARM7DTMI is an ARMv4T architecture, and indee=
d
Quoted 2 lines
cp15
Quoted 1 line
is mandatory only for ARMv6 and up, but ARM also states cp15 support =
was a
Quoted 13 lines
Quoted 1 line
de facto standard already for ARMv4.
=20
Yes it is de facto when you have a core with that support - typically an MMU and caches. But in that case it would have three digits, as in ARM720T, rather than ARM7TDMI. It is definitely an ARM7TDMI (actually -S) core in the datasheet, and there is no external CP15 block shown, etc. (Although I can see a cache!)
=20Quoted 5 lines
So I am left with the question: would the Tegra2 AVP be the only ARM implementation supported by U-Boot that does not have a cp15? That is=
possible, but I want direct testimony from Nividia.
Quoted 11 lines
=20
No there are lots and lots of ARM7TDMIs out there, just not that many that run U-Boot - and Linux is hard without an MMU. But even in the U-Boot tree we have the s3c44b0 cpu which seems to be a plain ARM7TDMI.
=20
In terms of direct testimony, two engineers are on this thread and may wish to chime in. The datasheet is pretty clear to me... =20Quoted 2 lines
This is why I asked about the Tegra2 TRM, or whatever Nvidia calls it=
, in
Quoted 1 line
Quoted 1 line
case it would explicitely state if AVP has cp15 support or not. Faili=
ng
Quoted 5 lines
=20
See above, it clearly states ARM7TDMI-S.
=20Quoted 2 lines
that, I'd be ok with experimenting but through the AVP, not through debugging tools -- encoding a cp15 MIDR read in the U-Boot startup co=
de,
Quoted 1 line
Quoted 1 line
step through it with the debugger and see if it causes an UND or not,=
=20and
Quoted 2 lines
if
Quoted 1 line
not, what is the hex value of r0 -- maybe that is exactly what you di=
d,
Quoted 12 lines
but
Quoted 1 line
I am not 100% sure it is, hence my insistence.
=20
OK I have done this, and yes the AVP definitely takes the undef exception when you execute:
=20
mrc p15, 0, r0, c0, c0, 0
=20Quoted 2 lines
I am especially surprised that a recent core be synthesized without a=
means
Quoted 10 lines
Quoted 1 line
for run-time core identification, especially in a design with two ARM=
cores.
=20
The -S means synthesized. It does have its own method of identification as I mentioned. There is a Tegra-specific register that I can read.
=20Quoted 2 lines
Quoted 2 lines
The simplest thing I have been able to think of that does not involv=
e
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
exceptions, differing instruction behaviour, doing the init later or=
putting in some Tegra-specific code is to check for the existence of=
the Q bit in the CPSR (actually APSR on ARMv7). This does seem to wo=
rk
Quoted 6 lines
Quoted 6 lines
Quoted 4 lines
and I have verified both in my old 1996 ARM ARM DDI 0100B and the ARMv7-A one (DDI 0406B) that from an architecture point of view this=
should work. The Q bit is RAZ on ARMv4T.
This could hep if we really cannot access the Main ID Register on the=
=20AVP.
Quoted 14 lines
=20
OK, well I will send a patch set up with this change. =20Quoted 11 lines
Quoted 11 lines
I believe this will cope with the Cortex-A7 / A-15 combinations and possibly even Cortex-R4 / A-15 although I have not tested this. I suppose we can deal with this when it becomes an issue.
So I have redone this one patch with that in mind, and adjusted the series slightly to fit with this. I will resend it when it completes=
MAKEALL.
I hope that this resolves the matter, but if not(!), I would very mu=
ch
Quoted 4 lines
Quoted 4 lines
Quoted 2 lines
appreciate it if you could send through some actual pseudo code showing what you are looking for, to avoid any confusion.
Well, I just want to see if the MIDR is accessible and what its value=
=20is,
Quoted 9 lines
so
Quoted 5 lines
I want the AVP to execute
=A0 =A0 =A0 =A0mrc =A0 =A0 p15, 0, r0, c0, c0, 0
The ending 0 is what selects MIDR rather than other cp15 registers --=
other
Quoted 1 line
values can cause UND (and I would gladly understand that AVP goes UND=
=20for
Quoted 3 lines
Quoted 3 lines
reading cp15 CTR for instance).
The simplest test would be to insert the exact instruction above in t=
he
Quoted 2 lines
Quoted 2 lines
reset sequence in
start.Sright after SVC32 switch, debug the reset execution path, see if the mrc above goes UND or else check r0's cont=
ents
Quoted 23 lines
Quoted 1 line
after mrc is done.
=20
OK see above, I have done this. What I meant was for you to provide a code sequence that you want instart.S. Hopefully my patch will fit the bill.
=20
I am very happy for this to be rewritten/changed down the track. But for now, and assuming you don't want to call a function to find out whether or not CP15 exists, I have created something which seems to solve the problem. There are many other problems to solve. I feel that this one has had its fair share of attention!
=20
Regards,
Simon
=20Quoted 8 lines
Quoted 3 lines
Thanks,
SimonAmicalement,
--
Albert.
-------------------------------------------------------------------------=
----------
This email message is for the sole use of the intended recipient(s) and m= ay contain
confidential information. Any unauthorized review, use, disclosure or di= stribution
is prohibited. If you are not the intended recipient, please contact the= =20sender by
reply email and destroy all copies of the original message.
-------------------------------------------------------------------------=
----------