From: Albert ARIBAUD <albert.u.boot@aribaud.net>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 3/9] arm: Move CP15 init out of cpu_init_crit()
Date: Sun, 30 Oct 2011 11:16:09 +0100 [thread overview]
Message-ID: <4EAD23E9.3090605@aribaud.net> (raw)
In-Reply-To: <CAPnjgZ2p-TKtXC9PGHZAQwHTTUMfsZpq3kcsvxXPhJFHV+_J3Q@mail.gmail.com>
Hi Simon,
Le 29/10/2011 02:36, Simon Glass a ?crit :
> Hi Albert,
>
> On Thu, Oct 27, 2011 at 10:09 PM, Albert ARIBAUD
> <albert.u.boot@aribaud.net> wrote:
>> Le 28/10/2011 03:43, Simon Glass a ?crit :
>>
>>> The test was
>>>
>>> mrc p15, 0, r0, c0, c0, 0 @ get ID register
>>> and r0, r0, #0xf0000 @ get architecture
>>> cmp r0, #0xf0000 @ check for> ARMv6
>>> movne pc, lr @ else skip cache init
>>>
>>> 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 /
> RVdebug and it definitely doesn't have a CP15. [as Ford Prefect would
> say, I counted them twice]
Ok, so debug tools do not show cp15. But tools can be tailored to what
tool makes think is needed -- I could tell about some debugging tools
that will not let me see all I want a core because the debug designers
had finite resources and what I wanted was not a priority to them.
OTOH, according to ARM, ARM7DTMI is an ARMv4T architecture, and indeed
cp15 is mandatory only for ARMv6 and up, but ARM also states cp15
support was a de facto standard already for ARMv4.
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.
This is why I asked about the Tegra2 TRM, or whatever Nvidia calls it,
in case it would explicitely state if AVP has cp15 support or not.
Failing 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 code, step through it with the debugger and see if it causes an
UND or not, and if not, what is the hex value of r0 -- maybe that is
exactly what you did, but I am not 100% sure it is, hence my insistence.
I am especially surprised that a recent core be synthesized without a
means for run-time core identification, especially in a design with two
ARM cores.
> The simplest thing I have been able to think of that does not involve
> 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 work
> 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 AVP.
> 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 much
> 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
is, so I want the AVP to execute
mrc p15, 0, r0, c0, c0, 0
The ending 0 is what selects MIDR rather than other cp15 registers --
other values can cause UND (and I would gladly understand that AVP goes
UND for reading cp15 CTR for instance).
The simplest test would be to insert the exact instruction above in the
reset sequence in start.S right after SVC32 switch, debug the reset
execution path, see if the mrc above goes UND or else check r0's
contents after mrc is done.
> Thanks,
> Simon
Amicalement,
--
Albert.
next prev parent reply other threads:[~2011-10-30 10:16 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-13 21:05 [U-Boot] [PATCH 0/9] tegra2: Tidy up boot path Simon Glass
2011-10-13 21:05 ` [U-Boot] [PATCH 1/9] tegra2: Add arch_cpu_init() to fire up Cortex-A9 Simon Glass
2011-10-13 22:52 ` Mike Frysinger
2011-10-13 23:18 ` Simon Glass
2011-10-13 23:34 ` Mike Frysinger
2011-10-14 0:47 ` Simon Glass
2011-10-13 21:05 ` [U-Boot] [PATCH 2/9] tegra2: Simplify tegra_start() boot path Simon Glass
2011-10-13 21:05 ` [U-Boot] [PATCH 3/9] arm: Move CP15 init out of cpu_init_crit() Simon Glass
2011-10-21 20:58 ` Albert ARIBAUD
2011-10-21 21:18 ` Simon Glass
2011-10-21 21:43 ` Albert ARIBAUD
2011-10-21 21:54 ` Simon Glass
2011-10-21 22:24 ` Albert ARIBAUD
2011-10-22 5:05 ` Simon Glass
2011-10-22 7:56 ` Albert ARIBAUD
2011-10-22 16:13 ` Simon Glass
2011-10-24 19:34 ` Simon Glass
2011-10-24 20:04 ` Albert ARIBAUD
2011-10-24 20:14 ` Simon Glass
2011-10-24 21:21 ` Albert ARIBAUD
2011-10-25 5:02 ` Simon Glass
2011-10-25 6:41 ` Albert ARIBAUD
2011-10-25 13:44 ` Simon Glass
2011-10-25 21:16 ` Simon Glass
2011-10-27 20:05 ` Albert ARIBAUD
2011-10-27 20:17 ` Simon Glass
2011-10-27 22:39 ` Albert ARIBAUD
2011-10-27 22:46 ` Simon Glass
2011-10-28 1:43 ` Simon Glass
2011-10-28 5:09 ` Albert ARIBAUD
2011-10-29 0:36 ` Simon Glass
2011-10-30 10:16 ` Albert ARIBAUD [this message]
2011-10-31 21:44 ` Simon Glass
2011-10-31 22:54 ` Tom Warren
2011-11-05 5:17 ` Simon Glass
2011-11-05 8:09 ` Albert ARIBAUD
2011-11-05 13:36 ` Simon Glass
2011-10-28 5:07 ` Albert ARIBAUD
2011-11-05 8:17 ` Albert ARIBAUD
2011-11-05 14:00 ` Simon Glass
2011-10-13 21:05 ` [U-Boot] [PATCH 4/9] tegra2: Enable instruction cache Simon Glass
2011-10-13 21:05 ` [U-Boot] [PATCH 5/9] tegra2: Remove unneeded boot code Simon Glass
2011-10-13 21:06 ` [U-Boot] [PATCH 6/9] tegra2: Remove unneeded config option Simon Glass
2011-10-13 21:06 ` [U-Boot] [PATCH 7/9] tegra2: Remove unused low-level Tegra2 UART code Simon Glass
2011-10-13 21:06 ` [U-Boot] [PATCH 8/9] tegra2: Remove unneeded 'dynamic ram size' message Simon Glass
2011-10-13 21:06 ` [U-Boot] [PATCH 9/9] tegra2: Don't use board pointer before it is set up Simon Glass
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=4EAD23E9.3090605@aribaud.net \
--to=albert.u.boot@aribaud.net \
--cc=u-boot@lists.denx.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox