From patchwork Sun Jan 19 15:19:00 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 312376 X-Patchwork-Delegate: yorksun@freescale.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 91F522C007C for ; Mon, 20 Jan 2014 02:34:35 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6C9144AEF0; Sun, 19 Jan 2014 16:34:26 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id obJyeA66iZSY; Sun, 19 Jan 2014 16:34:26 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id CFCFA4AF0D; Sun, 19 Jan 2014 16:34:11 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5A4894AEB1 for ; Sun, 19 Jan 2014 16:34:04 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JPep7xaFGgOE for ; Sun, 19 Jan 2014 16:34:02 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by theia.denx.de (Postfix) with ESMTPS id 477F74AEB7 for ; Sun, 19 Jan 2014 16:33:55 +0100 (CET) Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id A6CC2AC60; Sun, 19 Jan 2014 15:19:09 +0000 (UTC) From: Alexander Graf To: u-boot@lists.denx.de Date: Sun, 19 Jan 2014 16:19:00 +0100 Message-Id: <1390144742-4953-2-git-send-email-agraf@suse.de> X-Mailer: git-send-email 1.7.12.4 In-Reply-To: <1390144742-4953-1-git-send-email-agraf@suse.de> References: <1390144742-4953-1-git-send-email-agraf@suse.de> Cc: Scott Wood , "qemu-ppc@nongnu.org" , York Sun Subject: [U-Boot] [PATCH 1/3] PPC 85xx: Detect e500v2 / e500mc during runtime X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de 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 --- 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 SET_IVOR(36, 0x280) /* Processor doorbell */ SET_IVOR(37, 0x2a0) /* Processor doorbell critical */ SET_IVOR(38, 0x2c0) /* Guest Processor doorbell */ @@ -54,6 +62,8 @@ SET_IVOR(40, 0x300) /* Hypervisor system call */ SET_IVOR(41, 0x320) /* Hypervisor Priviledge */ +#ifndef CONFIG_QEMU_E500 + /* QEMU guests runs in guest mode and can't access GIVORs */ SET_GIVOR(2, 0x060) /* Guest Data Storage */ SET_GIVOR(3, 0x080) /* Guest Instruction Storage */ SET_GIVOR(4, 0x0a0) /* Guest External Input */ @@ -61,3 +71,4 @@ SET_GIVOR(13, 0x1c0) /* Guest Data TLB Error */ SET_GIVOR(14, 0x1e0) /* Guest Instruction TLB Error */ #endif +2: