From patchwork Tue Jul 17 06:30:10 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bharat Bhushan X-Patchwork-Id: 171341 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 2C4A72C0188 for ; Tue, 17 Jul 2012 16:29:24 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754083Ab2GQG3X (ORCPT ); Tue, 17 Jul 2012 02:29:23 -0400 Received: from [213.199.154.207] ([213.199.154.207]:37225 "EHLO am1outboundpool.messaging.microsoft.com" rhost-flags-FAIL-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1753205Ab2GQG3W (ORCPT ); Tue, 17 Jul 2012 02:29:22 -0400 Received: from mail43-am1-R.bigfish.com (10.3.201.247) by AM1EHSOBE003.bigfish.com (10.3.204.23) with Microsoft SMTP Server id 14.1.225.23; Tue, 17 Jul 2012 06:27:56 +0000 Received: from mail43-am1 (localhost [127.0.0.1]) by mail43-am1-R.bigfish.com (Postfix) with ESMTP id 2B3886012E; Tue, 17 Jul 2012 06:27:56 +0000 (UTC) X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPV:NLI; H:mail.freescale.net; RD:none; EFVD:NLI X-SpamScore: 3 X-BigFish: VS3(zzzz1202h1082kzz8275bhz2dh2a8h668h839he5bhf0ah) Received: from mail43-am1 (localhost.localdomain [127.0.0.1]) by mail43-am1 (MessageSwitch) id 1342506474683287_11171; Tue, 17 Jul 2012 06:27:54 +0000 (UTC) Received: from AM1EHSMHS009.bigfish.com (unknown [10.3.201.248]) by mail43-am1.bigfish.com (Postfix) with ESMTP id A4F7B4004A; Tue, 17 Jul 2012 06:27:54 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by AM1EHSMHS009.bigfish.com (10.3.207.109) with Microsoft SMTP Server (TLS) id 14.1.225.23; Tue, 17 Jul 2012 06:27:54 +0000 Received: from tx30smr01.am.freescale.net (10.81.153.31) by 039-SN1MMR1-003.039d.mgd.msft.net (10.84.1.16) with Microsoft SMTP Server (TLS) id 14.2.298.5; Tue, 17 Jul 2012 01:27:51 -0500 Received: from freescale.com ([10.232.15.72]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with SMTP id q6H6Rjtq026589; Mon, 16 Jul 2012 23:27:48 -0700 Received: by freescale.com (sSMTP sendmail emulation); Tue, 17 Jul 2012 12:00:11 +0530 From: Bharat Bhushan To: , , CC: Bharat Bhushan , Bharat Bhushan Subject: [PATCH v2] openpic: Added BRR1 register Date: Tue, 17 Jul 2012 12:00:10 +0530 Message-ID: <1342506610-16705-1-git-send-email-Bharat.Bhushan@freescale.com> X-Mailer: git-send-email 1.7.0.4 MIME-Version: 1.0 X-OriginatorOrg: freescale.com Sender: kvm-ppc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm-ppc@vger.kernel.org Linux mpic driver uses (changes may be in pipeline to get upstreamed soon) BRR1. This patch adds the support to emulate readonly BRR1. Currently QEMU does not fully emulate any version on MPIC, so the MPIC Major number and Minor number are set to 0. Signed-off-by: Bharat Bhushan --- hw/openpic.c | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-) diff --git a/hw/openpic.c b/hw/openpic.c index 58ef871..aad2ee9 100644 --- a/hw/openpic.c +++ b/hw/openpic.c @@ -130,6 +130,16 @@ enum { #define MPIC_CPU_REG_START 0x20000 #define MPIC_CPU_REG_SIZE 0x100 + ((MAX_CPU - 1) * 0x1000) +/* + * Block Revision Register1 (BRR1): QEMU does not fully emulate + * any version on MPIC. So to start with, set the IP version to 0. + */ +#define BRR1_IPID 0x00400000 /* IP-block ID */ +#define BRR1_IPMJ 0x00000000 /* IP major number */ +#define BRR1_IPMN 0x00000000 /* IP minor number */ + + + enum mpic_ide_bits { IDR_EP = 31, IDR_CI0 = 30, @@ -595,6 +605,8 @@ static void openpic_gbl_write (void *opaque, target_phys_addr_t addr, uint32_t v if (addr & 0xF) return; switch (addr) { + case 0x00: /* Block Revision Register1 (BRR1) is Readonly */ + break; case 0x40: case 0x50: case 0x60: @@ -671,6 +683,7 @@ static uint32_t openpic_gbl_read (void *opaque, target_phys_addr_t addr) case 0x1090: /* PINT */ retval = 0x00000000; break; + case 0x00: /* Block Revision Register1 (BRR1) */ case 0x40: case 0x50: case 0x60: @@ -893,6 +906,9 @@ static uint32_t openpic_cpu_read_internal(void *opaque, target_phys_addr_t addr, dst = &opp->dst[idx]; addr &= 0xFF0; switch (addr) { + case 0x00: /* Block Revision Register1 (BRR1) */ + retval = BRR1_IPID | BRR1_IPMJ | BRR1_IPMN; + break; case 0x80: /* PCTP */ retval = dst->pctp; break;