From: York Sun <yorksun@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 1/6] PPC 85xx: Detect e500v2 / e500mc during runtime
Date: Fri, 31 Jan 2014 10:05:34 -0800 [thread overview]
Message-ID: <52EBE5EE.8050102@freescale.com> (raw)
In-Reply-To: <1391166969-25845-2-git-send-email-agraf@suse.de>
On 01/31/2014 03:16 AM, Alexander Graf wrote:
> With the qemu-ppce500 machine type we can run the same board with
> either an e500v2 or an e500mc core plugged in.
>
> This means that the IVOR setup can't be based on compile time decisions,
> so instead we have to do a runtime check which CPU generation we're
> running on.
>
> Signed-off-by: Alexander Graf <agraf@suse.de>
> ---
> arch/powerpc/cpu/mpc85xx/fixed_ivor.S | 21 ++++++++++++++++-----
> 1 file changed, 16 insertions(+), 5 deletions(-)
>
> diff --git a/arch/powerpc/cpu/mpc85xx/fixed_ivor.S b/arch/powerpc/cpu/mpc85xx/fixed_ivor.S
> index ebbb8c0..635a97e 100644
> --- a/arch/powerpc/cpu/mpc85xx/fixed_ivor.S
> +++ b/arch/powerpc/cpu/mpc85xx/fixed_ivor.S
> @@ -36,17 +36,25 @@
> SET_IVOR(14, 0x1e0) /* Instruction TLB Error */
> SET_IVOR(15, 0x040) /* Debug */
>
> -/* e500v1 & e500v2 only */
> -#ifndef CONFIG_E500MC
> + /* Check for CPU */
> + mfpvr r3
> + srwi r3, r3, 16
> + /* Compare with e500mc PVR major number */
> + li r4, 0
> + ori r4, r4, 0x8023
> + cmpw r3, r4
> +
> + /* e500v1 & e500v2 only */
> + bge 1f
> SET_IVOR(32, 0x200) /* SPE Unavailable */
> SET_IVOR(33, 0x220) /* Embedded FP Data */
> SET_IVOR(34, 0x240) /* Embedded FP Round */
> -#endif
> +1:
>
> SET_IVOR(35, 0x260) /* Performance monitor */
>
> -/* e500mc only */
> -#ifdef CONFIG_E500MC
> + /* e500mc only */
> + blt 2f
This "blt" has a risk. Please put a comment warning developers who will modify
the code to be sure the flag has not been updated since last "cmpw".
York
next prev parent reply other threads:[~2014-01-31 18:05 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-31 11:16 [U-Boot] [PATCH v2 0/6] PPC 85xx: Add support for QEMU's ppce500 PV machine Alexander Graf
2014-01-31 11:16 ` [U-Boot] [PATCH v2 1/6] PPC 85xx: Detect e500v2 / e500mc during runtime Alexander Graf
2014-01-31 18:05 ` York Sun [this message]
2014-02-04 1:59 ` Scott Wood
2014-02-06 11:40 ` Alexander Graf
2014-02-07 0:51 ` Scott Wood
2014-02-07 11:52 ` Alexander Graf
2014-02-07 16:54 ` Scott Wood
2014-01-31 11:16 ` [U-Boot] [PATCH v2 2/6] PPC 85xx: Add ELF entry point Alexander Graf
2014-01-31 11:16 ` [U-Boot] [PATCH v2 3/6] PPC 85xx: Add qemu-ppce500 machine Alexander Graf
2014-01-31 18:05 ` York Sun
2014-02-03 23:24 ` Scott Wood
2014-02-04 2:19 ` Scott Wood
2014-02-06 12:48 ` Alexander Graf
2014-02-06 22:55 ` Scott Wood
2014-02-06 23:28 ` Alexander Graf
2014-02-06 23:33 ` Scott Wood
2014-01-31 11:16 ` [U-Boot] [PATCH v2 4/6] PPC 85xx: Find CCSRBAR on ppce500 from device tree Alexander Graf
2014-02-04 2:24 ` Scott Wood
2014-02-06 13:02 ` Alexander Graf
2014-01-31 11:16 ` [U-Boot] [PATCH v2 5/6] PPC 85xx: Find PCI host controllers " Alexander Graf
2014-02-04 2:47 ` Scott Wood
2014-02-06 13:26 ` Alexander Graf
2014-02-06 22:52 ` Scott Wood
2014-02-07 12:25 ` Alexander Graf
2014-02-07 18:43 ` Scott Wood
2014-02-07 14:54 ` Alexander Graf
2014-02-07 15:00 ` [U-Boot] [Qemu-ppc] " Alexander Graf
2014-02-07 18:46 ` Scott Wood
2014-01-31 11:16 ` [U-Boot] [PATCH v2 6/6] PPC 85xx: Find CPU speed " Alexander Graf
2014-02-04 2:52 ` Scott Wood
2014-02-06 11:11 ` Alexander Graf
2014-02-07 1:33 ` Scott Wood
2014-02-07 11:50 ` Alexander Graf
2014-02-07 16:51 ` Scott Wood
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=52EBE5EE.8050102@freescale.com \
--to=yorksun@freescale.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.