From patchwork Sat Mar 11 23:01:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Filippov X-Patchwork-Id: 9619163 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 18A78604A9 for ; Sat, 11 Mar 2017 23:02:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 08A0528474 for ; Sat, 11 Mar 2017 23:02:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EF52228504; Sat, 11 Mar 2017 23:02:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, FROM_LOCAL_NOVOWEL, HK_RANDOM_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 88B0728474 for ; Sat, 11 Mar 2017 23:02:06 +0000 (UTC) Received: from localhost ([::1]:44951 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cmq1U-0000Em-Ob for patchwork-qemu-devel@patchwork.kernel.org; Sat, 11 Mar 2017 18:02:04 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58200) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cmq1L-0000EC-2n for qemu-devel@nongnu.org; Sat, 11 Mar 2017 18:01:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cmq1H-0000fB-5j for qemu-devel@nongnu.org; Sat, 11 Mar 2017 18:01:55 -0500 Received: from mail-pf0-x242.google.com ([2607:f8b0:400e:c00::242]:35911) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cmq1H-0000cF-0T for qemu-devel@nongnu.org; Sat, 11 Mar 2017 18:01:51 -0500 Received: by mail-pf0-x242.google.com with SMTP id j5so14848774pfb.3 for ; Sat, 11 Mar 2017 15:01:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=dCMA8wz3Alq6xeHRMd9uTbSM2UCxQOgJbpk1aCjiE0o=; b=VoqLtlrOmzO/DCfZonBFA09c10+jRLsj9BUgNP0dDTs2xmPH3TThO7MRfPWMcXLnJ4 AvZ+/3g1D1gw5qtR3h2LHQjahPcIyreXU7m3rMRo0i0/405Hqs8hzxT8QMHqxkOsq65v QnIas52BAOSvv5hjwv01QvNJUpXwGjymGeY8leDKVqfCgw09K53c6ZvMywwQa3axZ+no ajxljRqneoXms3wxyP9Oh0FiCumooLm9NOxuUnxn4DyhtUN0r1hFhjHCXZ8AKErBdO27 RE82giLc7OrYJ4KBUXFnE/d01R86N6pJoYaEoeP9x6XiE8lIk3Zca0l0cL3IKmSZiv2x Y2Sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=dCMA8wz3Alq6xeHRMd9uTbSM2UCxQOgJbpk1aCjiE0o=; b=ZiGPA4JL176LLKCvhh+ScqUYy7RW8bdw5IV7YYSLbHOI6jo8j4qJ8gTW4nMVKDQQ6L WUaXNQAvXrVKcOq2WeqKjtDMeyDmxKb4iGr+yXwN3QyvIZGWlzidfXt9Cwo1QufJ8nf3 E8hmb36UUArL71THk6eGsPIENyX9yc1+gqU/bv87P/cWXBzdTbR9XRwwZpsFAWHztHPt 5fWlUshgxebaxqJ7/78EjNiUQLfy7NKKFMyhpsVDDd5qWQDY/JYA/15tZ0Jug9VTOGS2 VcX91UYyaCRqEq+0Heso2+WopzCR9iM9urqJtsvAYuZHTtTyAWW+8sCmu/L94Nzi7iDi t63g== X-Gm-Message-State: AMke39nlG6RyDfs083oBt1BeOmkdo+u6maFJredu/httJDzjlCQ/nq7u8jgWB9a4J8tWzA== X-Received: by 10.84.133.36 with SMTP id 33mr35639026plf.87.1489273305813; Sat, 11 Mar 2017 15:01:45 -0800 (PST) Received: from octofox.metropolis ([12.47.132.3]) by smtp.gmail.com with ESMTPSA id d2sm26053208pgf.35.2017.03.11.15.01.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 11 Mar 2017 15:01:45 -0800 (PST) From: Max Filippov To: qemu-devel@nongnu.org Date: Sat, 11 Mar 2017 15:01:33 -0800 Message-Id: <1489273293-22586-1-git-send-email-jcmvbkbc@gmail.com> X-Mailer: git-send-email 2.1.4 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400e:c00::242 Subject: [Qemu-devel] [PATCH] target/xtensa: xtfpga: load DTB only when FDT support is enabled X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Max Filippov Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP xtensa linux can use DTB but does not require it, so FDT support is not a requirement for target/xtensa. Don't try to load DTB when FDT support is not configured. Signed-off-by: Max Filippov --- hw/xtensa/xtfpga.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/hw/xtensa/xtfpga.c b/hw/xtensa/xtfpga.c index dc6fdcc..11176e2 100644 --- a/hw/xtensa/xtfpga.c +++ b/hw/xtensa/xtfpga.c @@ -317,6 +317,7 @@ static void lx_init(const LxBoardDesc *board, MachineState *machine) cur_tagptr = put_tag(cur_tagptr, BP_TAG_COMMAND_LINE, strlen(kernel_cmdline) + 1, kernel_cmdline); } +#ifdef CONFIG_FDT if (dtb_filename) { int fdt_size; void *fdt = load_device_tree(dtb_filename, &fdt_size); @@ -332,6 +333,14 @@ static void lx_init(const LxBoardDesc *board, MachineState *machine) sizeof(dtb_addr), &dtb_addr); cur_lowmem = QEMU_ALIGN_UP(cur_lowmem + fdt_size, 4096); } +#else + if (dtb_filename) { + error_report("could not load DTB '%s': " + "FDT support is not configured in QEMU", + dtb_filename); + exit(EXIT_FAILURE); + } +#endif if (initrd_filename) { BpMemInfo initrd_location = { 0 }; int initrd_size = load_ramdisk(initrd_filename, cur_lowmem,