From patchwork Wed Jun 3 07:00:34 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 479780 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 825B314029E for ; Wed, 3 Jun 2015 17:01:48 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=dUHHCVBb; dkim-atps=neutral Received: from localhost ([::1]:33721 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z02gM-0007OP-OH for incoming@patchwork.ozlabs.org; Wed, 03 Jun 2015 03:01:46 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45162) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z02fr-0006Tp-3L for qemu-devel@nongnu.org; Wed, 03 Jun 2015 03:01:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z02fm-0000BO-4t for qemu-devel@nongnu.org; Wed, 03 Jun 2015 03:01:15 -0400 Received: from mail-pa0-x22f.google.com ([2607:f8b0:400e:c03::22f]:36789) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z02fl-0000At-SY for qemu-devel@nongnu.org; Wed, 03 Jun 2015 03:01:10 -0400 Received: by pabqy3 with SMTP id qy3so857973pab.3 for ; Wed, 03 Jun 2015 00:01:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=petj9g7ZST3q6u3P7MdYrbhhGMLUD5zKhcYuYWqhmHE=; b=dUHHCVBb+l92dzVHzFgKFS73+40Updx1XLKc/PG9R6Nug2xiWi2yiP+Jub1xY4OcAW 7UVP1EPfGxryqutzY0rdvPAdcbMdlvM0tEu8lXnwc/FM0jUUZ53Ws5DzNJmTOV0VLNu1 F5KIT/a+GPBfx6zjEVug4/FE75C6CqnSjKcvJFXyiHWHzln3tN9OuowuwDD8gKEhDMTG eEvgvE1Ah/DdgNuPgXIDZuhH6ZyhZtlyLW8pULAFotrhMoMiXfBK2l08bxBxE1bTJEc+ k3riWBmUiLaDVxBpWOgADpL/NfzFSaAeL0ghb80EoLSYaqnPjscYTnglgvgvZBw7LVWX 27Ig== X-Received: by 10.66.55.41 with SMTP id o9mr56863931pap.148.1433314868979; Wed, 03 Jun 2015 00:01:08 -0700 (PDT) Received: from localhost ([203.126.243.116]) by mx.google.com with ESMTPSA id jt2sm19534353pbc.21.2015.06.03.00.01.07 (version=TLSv1.1 cipher=RC4-SHA bits=128/128); Wed, 03 Jun 2015 00:01:08 -0700 (PDT) From: Alistair Francis To: qemu-devel@nongnu.org, edgar.iglesias@xilinx.com Date: Wed, 3 Jun 2015 17:00:34 +1000 Message-Id: <6914a01f86671039bf35be203411d00786b8cb28.1433314301.git.alistair.francis@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400e:c03::22f Cc: peter.crosthwaite@xilinx.com, alistair.francis@xilinx.com Subject: [Qemu-devel] [PATCH v1 6/8] ml605_mmu: Move the hardcoded values to the init function X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Move the hard coded register values to the init function. This also allows the entire reset function to be deleted, as PVR registers are now preserved on reset. Signed-off-by: Alistair Francis --- hw/microblaze/petalogix_ml605_mmu.c | 19 +++++++------------ 1 files changed, 7 insertions(+), 12 deletions(-) diff --git a/hw/microblaze/petalogix_ml605_mmu.c b/hw/microblaze/petalogix_ml605_mmu.c index f52654c..140a9d9 100644 --- a/hw/microblaze/petalogix_ml605_mmu.c +++ b/hw/microblaze/petalogix_ml605_mmu.c @@ -64,17 +64,6 @@ #define SPI_IRQ 4 #define UART16550_IRQ 5 -static void machine_cpu_reset(MicroBlazeCPU *cpu) -{ - CPUMBState *env = &cpu->env; - - env->pvr.regs[10] = 0x0e000000; /* virtex 6 */ - /* setup pvr to match kernel setting */ - env->pvr.regs[0] |= (0x14 << 8); - env->pvr.regs[4] = 0xc56b8000; - env->pvr.regs[5] = 0xc56be000; -} - static void petalogix_ml605_init(MachineState *machine) { @@ -206,10 +195,16 @@ petalogix_ml605_init(MachineState *machine) } } + /* setup PVR to match kernel settings */ + cpu->env.pvr.regs[0] |= (0x14 << 8); + cpu->env.pvr.regs[4] = 0xc56b8000; + cpu->env.pvr.regs[5] = 0xc56be000; + cpu->env.pvr.regs[10] = 0x0e000000; /* virtex 6 */ + microblaze_load_kernel(cpu, MEMORY_BASEADDR, ram_size, machine->initrd_filename, BINARY_DEVICE_TREE_FILE, - machine_cpu_reset); + NULL); }