From: thomas.petazzoni@free-electrons.com (Thomas Petazzoni)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2] ARM: add cpu_is_pj4() to distinguish PJ4 core
Date: Mon, 14 Apr 2014 15:12:36 +0200 [thread overview]
Message-ID: <20140414151236.75f8816d@skate> (raw)
In-Reply-To: <1395385319-25386-1-git-send-email-chao.xie@marvell.com>
Dear Chao Xie,
On Fri, 21 Mar 2014 15:01:58 +0800, Chao Xie wrote:
> +/*
> + * Marvell's PJ4 core is based on V7 version. It has some modification
> + * for coprocessor setting. For this reason, we need a way to distinguish
> + * it.
> + */
> +#ifndef CONFIG_CPU_PJ4
> +#define cpu_is_pj4() 0
> +#else
> +static inline int cpu_is_pj4(void)
> +{
> + unsigned int id;
> +
> + id = read_cpuid_id();
> + if ((id & 0xfffffff0) == 0x562f5840)
> + return 1;
Unfortunately, this doesn't work correctly, because this cpuid check
also matches Armada XP, which uses the PJ4B-MP core, but does not have
the iWMMXt extension. Therefore, when you build mach-mvebu with Dove
support enabled, it does not boot on Armada XP: it fails with an
undefined instruction.
Also, I believe the test is not sufficient because the Dove Armada 510
uses a PJ4 core, but is not matched by the above test.
For reference, the cpuid of various platforms:
* Armada XP, PJ4B-MP core, 0x562f5842
* Armada 370, PJ4B core, 0x561f5811
* Dove Armada 510, PJ4 core, 560f5815
Can you check on your platforms what was the exact cpuid, to see if we
can find a way of correcting this cpu_is_pj4() function? Can you also
check whether your CPU uses a PJ4, PJ4B or PJ4B-MP core?
Thanks,
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
next prev parent reply other threads:[~2014-04-14 13:12 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-21 7:01 [PATCH 1/2] ARM: add cpu_is_pj4() to distinguish PJ4 core Chao Xie
2014-03-21 7:01 ` [PATCH 2/2] ARM: PJ4: check cpu id for PJ4 cp0 access Chao Xie
2014-03-21 18:52 ` [PATCH 1/2] ARM: add cpu_is_pj4() to distinguish PJ4 core Stephen Warren
2014-03-24 18:58 ` Kevin Hilman
2014-03-24 19:38 ` Matt Porter
2014-04-01 20:18 ` Stephen Warren
2014-04-02 23:26 ` Kevin Hilman
2014-04-14 13:12 ` Thomas Petazzoni [this message]
2014-04-14 13:43 ` Russell King - ARM Linux
2014-04-14 15:27 ` Arnd Bergmann
2014-04-15 18:15 ` [PATCH 0/5] fixing regressions caused by Dove in MULTI_V7 Sebastian Hesselbarth
2014-04-15 18:15 ` [PATCH 1/5] ARM: iwmmxt: explicitly check for supported architectures Sebastian Hesselbarth
2014-04-15 18:16 ` [PATCH 2/5] ARM: pj4: enable iWMMXt only if CONFIG_IWMMXT is set Sebastian Hesselbarth
2014-04-15 18:16 ` [PATCH 3/5] ARM: pj4: properly detect existence of iWMMXt coprocessor Sebastian Hesselbarth
2014-04-15 18:16 ` [PATCH 4/5] ARM: pj4: fix cpu_is_pj4 check Sebastian Hesselbarth
2014-04-15 18:16 ` [PATCH 5/5] ARM: iwmmxt: allow to build iWMMXt on Marvell PJ4B Sebastian Hesselbarth
2014-04-16 8:44 ` [PATCH 0/5] fixing regressions caused by Dove in MULTI_V7 Thomas Petazzoni
2014-04-21 18:30 ` Thomas Petazzoni
2014-04-22 16:03 ` Kevin Hilman
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=20140414151236.75f8816d@skate \
--to=thomas.petazzoni@free-electrons.com \
--cc=linux-arm-kernel@lists.infradead.org \
/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;
as well as URLs for NNTP newsgroup(s).