From: Tony Lindgren <tony@atomide.com>
To: Russell King - ARM Linux <linux@arm.linux.org.uk>
Cc: linux-omap@vger.kernel.org
Subject: Re: cpu_is_omap15xx() doesn't get set for OMAP310
Date: Thu, 4 Sep 2008 14:51:13 -0700 [thread overview]
Message-ID: <20080904215109.GV23085@atomide.com> (raw)
In-Reply-To: <20080904211036.GH2309@flint.arm.linux.org.uk>
* Russell King - ARM Linux <linux@arm.linux.org.uk> [080904 14:10]:
> While trying out some of the changes in qemu (which emulates an OMAP310)
> I found that cpu_is_omap15xx() returns false.
>
> The comment says:
>
> * Macros to group OMAP into cpu classes.
> * These can be used in most places.
> * cpu_is_omap7xx(): True for OMAP730
> * cpu_is_omap15xx(): True for OMAP1510, OMAP5910 and OMAP310
>
> and cpu_is_omap15xx() is defined as:
>
> # define cpu_is_omap15xx() is_omap15xx()
>
> #define GET_OMAP_CLASS ((system_rev >> 24) & 0xff)
>
> #define IS_OMAP_CLASS(class, id) \
> static inline int is_omap ##class (void) \
> { \
> return (GET_OMAP_CLASS == (id)) ? 1 : 0; \
> }
>
> IS_OMAP_CLASS(15xx, 0x15)
>
>
> So, it's looking for the top byte of system_rev to be 0x15. However,
> the ID table in arch/arm/mach-omap1/id.c contains:
>
> { .jtag_id = 0xb574, .die_rev = 0x2, .omap_id = 0x03310315, .type = 0x03100000},
>
> so the top byte contains 0x03. Moreover, it goes on to say:
>
> /* Add the cpu class info (7xx, 15xx, 16xx, 24xx) */
> cpu_type = system_rev >> 24;
> switch (cpu_type) {
> case 0x03:
> system_rev |= 0x15;
> break;
>
> So, if this code is supposed to be setting the cpu class, it's setting
> it in the low byte.
>
> It looks to me like the omap1 ID code is out of step with the omap2 ID
> code, or omap310 ID support is broken.
Looks like adding omap2 detection has broken this by stuffing in other
data there and tweaking GET_OMAP_CLASS macro. And again we have
something that's mostly working only by accident.
Probably the right fix would be to keep the original low byte as the
cpu class, fix the GET_OMAP_CLASS macro, clean-up mach-omap2/id.c
and set up static u32 system_mode to indicate HS or GP omap (High
Security vs General Purpose). That would still leave one byte in
system_rev to indicate processor revision (ES1, ES2.0).
The ugly short term fix would be to define IS_OMAP_CLASS in a different
way for omap1 and omap2. Anyways, I can fix it properly unless you're
already patching it.
Tony
next prev parent reply other threads:[~2008-09-04 21:51 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-04 21:10 cpu_is_omap15xx() doesn't get set for OMAP310 Russell King - ARM Linux
2008-09-04 21:51 ` Tony Lindgren [this message]
2008-09-04 22:10 ` Russell King - ARM Linux
2008-09-10 3:38 ` Tony Lindgren
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=20080904215109.GV23085@atomide.com \
--to=tony@atomide.com \
--cc=linux-omap@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
/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