From patchwork Tue Jun 5 23:53:06 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 163230 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id E9998B6EE7 for ; Wed, 6 Jun 2012 11:53:45 +1000 (EST) Received: from localhost ([::1]:44537 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sc3bl-0001zZ-6Z for incoming@patchwork.ozlabs.org; Tue, 05 Jun 2012 19:56:17 -0400 Received: from eggs.gnu.org ([208.118.235.92]:44336) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sc3aA-0007wb-Gj for qemu-devel@nongnu.org; Tue, 05 Jun 2012 19:55:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sc3Z6-0002RN-2l for qemu-devel@nongnu.org; Tue, 05 Jun 2012 19:54:38 -0400 Received: from cantor2.suse.de ([195.135.220.15]:36441 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sc3Z5-0002QF-P9; Tue, 05 Jun 2012 19:53:31 -0400 Received: from relay1.suse.de (unknown [195.135.220.254]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id 545F0A30B8; Wed, 6 Jun 2012 01:53:30 +0200 (CEST) From: Alexander Graf To: "qemu-devel@nongnu.org Developers" Date: Wed, 6 Jun 2012 01:53:06 +0200 Message-Id: <1338940402-28502-16-git-send-email-agraf@suse.de> X-Mailer: git-send-email 1.6.0.2 In-Reply-To: <1338940402-28502-1-git-send-email-agraf@suse.de> References: <1338940402-28502-1-git-send-email-agraf@suse.de> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 X-Received-From: 195.135.220.15 Cc: qemu-ppc Mailing List Subject: [Qemu-devel] [PATCH 15/31] PPC: e500: dt: create /soc8544 node dynamically 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 Signed-off-by: Alexander Graf --- hw/ppce500_mpc8544ds.c | 17 +++++++++++++++++ pc-bios/mpc8544ds.dts | 9 --------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/hw/ppce500_mpc8544ds.c b/hw/ppce500_mpc8544ds.c index 63515bb..5ff2d24 100644 --- a/hw/ppce500_mpc8544ds.c +++ b/hw/ppce500_mpc8544ds.c @@ -43,6 +43,8 @@ #define RAM_SIZES_ALIGN (64UL << 20) #define MPC8544_CCSRBAR_BASE 0xE0000000 +#define MPC8544_CCSRBAR_REGSIZE 0x00001000 +#define MPC8544_CCSRBAR_SIZE 0x00100000 #define MPC8544_MPIC_REGS_BASE (MPC8544_CCSRBAR_BASE + 0x40000) #define MPC8544_SERIAL0_REGS_BASE (MPC8544_CCSRBAR_BASE + 0x4500) #define MPC8544_SERIAL1_REGS_BASE (MPC8544_CCSRBAR_BASE + 0x4600) @@ -78,6 +80,7 @@ static int mpc8544_load_device_tree(CPUPPCState *env, int i; char compatible[] = "MPC8544DS\0MPC85xxDS"; char model[] = "MPC8544DS"; + char soc[128]; filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, BINARY_DEVICE_TREE_FILE); if (!filename) { @@ -179,6 +182,20 @@ static int mpc8544_load_device_tree(CPUPPCState *env, } } + /* XXX These should go into their respective devices' code */ + sprintf(soc, "/soc8544@%x", MPC8544_CCSRBAR_BASE); + qemu_devtree_add_subnode(fdt, soc); + qemu_devtree_setprop_string(fdt, soc, "device_type", "soc"); + qemu_devtree_setprop_string(fdt, soc, "compatible", "simple-bus"); + qemu_devtree_setprop_cell(fdt, soc, "#address-cells", 1); + qemu_devtree_setprop_cell(fdt, soc, "#size-cells", 1); + qemu_devtree_setprop_cell3(fdt, soc, "ranges", 0x0, MPC8544_CCSRBAR_BASE, + MPC8544_CCSRBAR_SIZE); + qemu_devtree_setprop_cell2(fdt, soc, "reg", MPC8544_CCSRBAR_BASE, + MPC8544_CCSRBAR_REGSIZE); + /* XXX should contain a reasonable value */ + qemu_devtree_setprop_cell(fdt, soc, "bus-frequency", 0); + ret = rom_add_blob_fixed(BINARY_DEVICE_TREE_FILE, fdt, fdt_size, addr); if (ret < 0) { goto out; diff --git a/pc-bios/mpc8544ds.dts b/pc-bios/mpc8544ds.dts index 1eac8ef..01b53ba 100644 --- a/pc-bios/mpc8544ds.dts +++ b/pc-bios/mpc8544ds.dts @@ -18,15 +18,6 @@ }; soc8544@e0000000 { - #address-cells = <1>; - #size-cells = <1>; - device_type = "soc"; - compatible = "simple-bus"; - - ranges = <0x0 0xe0000000 0x100000>; - reg = <0xe0000000 0x1000>; // CCSRBAR 1M - bus-frequency = <0>; // Filled out by uboot. - serial0: serial@4500 { cell-index = <0>; device_type = "serial";