From patchwork Wed May 23 00:15:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Clark X-Patchwork-Id: 10419973 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 C1A47600CC for ; Wed, 23 May 2018 00:44:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B17FB205F6 for ; Wed, 23 May 2018 00:44:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A5B2628EAC; Wed, 23 May 2018 00:44:12 +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=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, 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 35B89205F6 for ; Wed, 23 May 2018 00:44:11 +0000 (UTC) Received: from localhost ([::1]:58620 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fLHsx-00024D-C8 for patchwork-qemu-devel@patchwork.kernel.org; Tue, 22 May 2018 20:44:11 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42961) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fLHUB-0000i8-Vl for qemu-devel@nongnu.org; Tue, 22 May 2018 20:18:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fLHU9-0001Ye-VZ for qemu-devel@nongnu.org; Tue, 22 May 2018 20:18:35 -0400 Received: from mail-pg0-x235.google.com ([2607:f8b0:400e:c05::235]:40731) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fLHU9-0001YA-LM for qemu-devel@nongnu.org; Tue, 22 May 2018 20:18:33 -0400 Received: by mail-pg0-x235.google.com with SMTP id l2-v6so8569274pgc.7 for ; Tue, 22 May 2018 17:18:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Ufm+6hrWR8XBnqiPCH/WLalNFljyXa45cS3OcyVXsK8=; b=XEh50GJw17M9SJGRpEmFbChu5R8XBXgLrZCpmYVRzY4G/imjDVJ8qj8Va8nQ9sXHrI DKZdNkWCpTYDLma1POFI3G+4auctcGWR9IVtGHg17BWroE7UI3wUTYjDKqNC1nuG+vpJ lBd+UBhwC4BeFgBoviUEz6yLzptEAwhfD6BwXU2aPdP15bvAgPYXL7VGYcZDabWOZmp5 mPzkHgj7yCdeWOi7TLBX1eRDhCtNVV+0dVrwkcOFZ2HrBBinltIUaVyTtkqR0b0y6CqB 9vSdHDzSfUeLHbabm9qIf+ING/ld9A1jNSXBUZV3cBKzhdkcAL1V/dnejNwfvB9ZFn5I 9BEQ== 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:in-reply-to :references; bh=Ufm+6hrWR8XBnqiPCH/WLalNFljyXa45cS3OcyVXsK8=; b=hIQjupJhhJ2MuwgRd6qI92bNYVODC1r1Apa1ottQZ/acIPtlEiSloBV4E5AkZDGkRa KtFrQJMotCFk1New3GAfzNz8Wqb2EVvfQ2FjQfSXlCACEnKY5QZeqKm3r/Q78f++fAiD sPVBATUWCFGnoGTOwmH1HSecN/RJXXyINvN/uTA+K5aOPv+ruzMxioHSmmsS224PgqaQ pMBCUr+sA5skP6TOVEvBvJ8a7IkNen+Y+gLoEmDFvRMANtxO+DKcBwyoATeNQIJXptew 6UXrYU2eQLcgSwI+Zc8Vb9mZQphNHHJQc8062QcvlKGnZ1e5RnMwo4xtNvEu2GNUm/Oy 6PPg== X-Gm-Message-State: ALKqPweibEF0RAVs/JVCjzbnTmtAA7JIMvUk3p7+3aLU9A8MTf1hdhey LS5yH+XfEAihK3jG0bVDZuTP3uunXv0= X-Google-Smtp-Source: AB8JxZomV4mJvEHsSc+9+1FMj4S+tZdRMgbCDJdvYIVZ7H4Hr5KdBzk6MSAGO9kDPmN0aTKkXH0mxw== X-Received: by 2002:a62:478d:: with SMTP id p13-v6mr591700pfi.164.1527034712697; Tue, 22 May 2018 17:18:32 -0700 (PDT) Received: from localhost.localdomain (122-58-167-22-fibre.bb.spark.co.nz. [122.58.167.22]) by smtp.gmail.com with ESMTPSA id j1-v6sm28935626pfh.95.2018.05.22.17.18.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 22 May 2018 17:18:32 -0700 (PDT) From: Michael Clark To: qemu-devel@nongnu.org Date: Wed, 23 May 2018 12:15:16 +1200 Message-Id: <1527034517-7851-30-git-send-email-mjc@sifive.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1527034517-7851-1-git-send-email-mjc@sifive.com> References: <1527034517-7851-1-git-send-email-mjc@sifive.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c05::235 Subject: [Qemu-devel] [PATCH v1 29/30] RISC-V: Don't add NULL bootargs to device-tree 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: patches@groups.riscv.org, Michael Clark Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP --- hw/riscv/sifive_u.c | 4 +++- hw/riscv/spike.c | 6 ++++-- hw/riscv/virt.c | 4 +++- 3 files changed, 10 insertions(+), 4 deletions(-) Reviewed-by: Philippe Mathieu-Daudé diff --git a/hw/riscv/sifive_u.c b/hw/riscv/sifive_u.c index 326b0f434cff..02721d43c474 100644 --- a/hw/riscv/sifive_u.c +++ b/hw/riscv/sifive_u.c @@ -206,7 +206,9 @@ static void create_fdt(SiFiveUState *s, const struct MemmapEntry *memmap, qemu_fdt_add_subnode(fdt, "/chosen"); qemu_fdt_setprop_string(fdt, "/chosen", "stdout-path", nodename); - qemu_fdt_setprop_string(fdt, "/chosen", "bootargs", cmdline); + if (cmdline) { + qemu_fdt_setprop_string(fdt, "/chosen", "bootargs", cmdline); + } g_free(nodename); } diff --git a/hw/riscv/spike.c b/hw/riscv/spike.c index f94e2b670799..5dd7d28aed4e 100644 --- a/hw/riscv/spike.c +++ b/hw/riscv/spike.c @@ -156,8 +156,10 @@ static void create_fdt(SpikeState *s, const struct MemmapEntry *memmap, g_free(cells); g_free(nodename); - qemu_fdt_add_subnode(fdt, "/chosen"); - qemu_fdt_setprop_string(fdt, "/chosen", "bootargs", cmdline); + if (cmdline) { + qemu_fdt_add_subnode(fdt, "/chosen"); + qemu_fdt_setprop_string(fdt, "/chosen", "bootargs", cmdline); + } } static void spike_v1_10_0_board_init(MachineState *machine) diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c index 321fa6e8122a..c889aa3cd269 100644 --- a/hw/riscv/virt.c +++ b/hw/riscv/virt.c @@ -253,7 +253,9 @@ static void *create_fdt(RISCVVirtState *s, const struct MemmapEntry *memmap, qemu_fdt_add_subnode(fdt, "/chosen"); qemu_fdt_setprop_string(fdt, "/chosen", "stdout-path", nodename); - qemu_fdt_setprop_string(fdt, "/chosen", "bootargs", cmdline); + if (cmdline) { + qemu_fdt_setprop_string(fdt, "/chosen", "bootargs", cmdline); + } g_free(nodename); return fdt;