linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] arm: pj4: check cpu id for pj4 cp0 access
Date: Fri, 14 Jun 2013 09:47:32 +0100	[thread overview]
Message-ID: <20130614084732.GL18614@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <1371199336-28027-1-git-send-email-chao.xie@marvell.com>

On Fri, Jun 14, 2013 at 04:42:16AM -0400, Chao Xie wrote:
> @@ -79,6 +82,15 @@ static void __init pj4_cp_access_write(u32 value)
>  static int __init pj4_cp0_init(void)
>  {
>  	u32 cp_access;
> +	u32 cpuid;
> +
> +	__asm__ __volatile__ (
> +		"mrc	p15, 0, %0, c0, c0\n\t"
> +		: "=r" (cpuid));
> +
> +	/* If it is not a pj4 core, skip it. */
> +	if ((cpuid & CORE_PJ4_MASK) != CORE_PJ4_ID)
> +		return 0;

We have a macro for reading the CPU ID, see asm/cputype.h

      reply	other threads:[~2013-06-14  8:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-14  8:42 [PATCH] arm: pj4: check cpu id for pj4 cp0 access Chao Xie
2013-06-14  8:47 ` Russell King - ARM Linux [this message]

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=20130614084732.GL18614@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --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).