From patchwork Wed Oct 17 21:54:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Palmer Dabbelt X-Patchwork-Id: 10646115 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EAF4A17D2 for ; Wed, 17 Oct 2018 22:07:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DBCC928998 for ; Wed, 17 Oct 2018 22:07:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CEBDA28A0D; Wed, 17 Oct 2018 22:07:51 +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.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 7770028998 for ; Wed, 17 Oct 2018 22:07:51 +0000 (UTC) Received: from localhost ([::1]:39298 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gCtyo-0001Id-OA for patchwork-qemu-devel@patchwork.kernel.org; Wed, 17 Oct 2018 18:07:50 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58527) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gCttn-0006QL-Q1 for qemu-devel@nongnu.org; Wed, 17 Oct 2018 18:02:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gCttk-0005gU-76 for qemu-devel@nongnu.org; Wed, 17 Oct 2018 18:02:39 -0400 Received: from mail-pf1-x42b.google.com ([2607:f8b0:4864:20::42b]:44884) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gCtti-0005c1-9U for qemu-devel@nongnu.org; Wed, 17 Oct 2018 18:02:34 -0400 Received: by mail-pf1-x42b.google.com with SMTP id r9-v6so13831963pff.11 for ; Wed, 17 Oct 2018 15:02:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding:cc:from:to; bh=OEkD21GVOVtazEL5WYjCk7sx+FIEjGZXeT4TtM2+DEk=; b=CH9OzcavlSpnvyuiRtsA5TVj2dYjveNlj/nGwbdvM+RR6K3Zx+jWzmA814WVE1e5JB vB0bEiUZGirIo/ErQ9JZOMswaeq3srmoaaaKzdoHm9e+7qTNOS2djE2dsWdgLyCR+kMY me60tx4b4AwvGEWD+cFhwWuLRvo8yStabmCjyqtf7wTX9XO47ZooOf73g1xpU7Uz/MW7 rE6KjCHaVr61/11qV1UfOt05mGjNSruSaC7OInakDiUDLhMbUZCjOwPL/mljbw7inE3U Kf1RumL8hxNNu3Oe3P/JghTP26vqPaOW0vhb+UNyl0knAeZUtmAnAtkF/O7bs4D4uNMv ngRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:cc:from:to; bh=OEkD21GVOVtazEL5WYjCk7sx+FIEjGZXeT4TtM2+DEk=; b=WMXJwNklW0z2z/2FMRYekHoLmhk5wWGxHh+UN0aaLQU84VS3LbUSiRWXXAOJERfm8m MK4rAexTEzk992CFdba71BFkfoFBhIx5ajq7fffB+kPd7ptnQ/XJjOI8Z4U5869peMDR frnEHX4hxWIN06V4C0k84zlvp8NOfALeXC2R2l2Gt5w5sV62kMrY/wAjDvQIEG9AD6bP yS95LQlF4xVURZX9JCtEAYum4SEEOFaBMih5MHIN/uLRhJmYuqu/mKD0aNzCxSVc+VHs 0SNoqCQobSVPzdT4ovG67giRhM6h5btGvqYkbBhQmuuQ8QiwHA5A1ZsozNXh3r4UdMha RzDw== X-Gm-Message-State: ABuFfohBP+/3hesH+dqJ981xOhDng/tJxKxRdshCTqx4FW9RKpNVlybS YjBIUnnOH80ZHZE2ZCHNAejDTA== X-Google-Smtp-Source: ACcGV63F0kpVCdz576azs6X30kZZR2ptXe5YyRDYxetSJHjsWh5cfHOzCu0jQUxKdpMnyNG0peTK8A== X-Received: by 2002:a62:b50a:: with SMTP id y10-v6mr27989854pfe.199.1539813750274; Wed, 17 Oct 2018 15:02:30 -0700 (PDT) Received: from localhost ([12.206.222.5]) by smtp.gmail.com with ESMTPSA id k24-v6sm23217484pfi.11.2018.10.17.15.02.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 17 Oct 2018 15:02:29 -0700 (PDT) Date: Wed, 17 Oct 2018 14:54:22 -0700 Message-Id: <20181017215422.3973-6-palmer@sifive.com> X-Mailer: git-send-email 2.18.1 In-Reply-To: <20181017215422.3973-1-palmer@sifive.com> References: <20181017215422.3973-1-palmer@sifive.com> MIME-Version: 1.0 From: Palmer Dabbelt To: Peter Maydell X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::42b Subject: [Qemu-devel] [PULL 5/5] 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: Michael Clark , Alistair Francis , qemu-devel@nongnu.org, Palmer Dabbelt Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Michael Clark Signed-off-by: Michael Clark Reviewed-by: Alistair Francis Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Palmer Dabbelt Signed-off-by: Alistair Francis Signed-off-by: Palmer Dabbelt --- hw/riscv/sifive_u.c | 4 +++- hw/riscv/spike.c | 6 ++++-- hw/riscv/virt.c | 4 +++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/hw/riscv/sifive_u.c b/hw/riscv/sifive_u.c index 862f8ff5f758..ef07df244241 100644 --- a/hw/riscv/sifive_u.c +++ b/hw/riscv/sifive_u.c @@ -230,7 +230,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 be5ef85e8109..8a712ed49026 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 6bd723dc3ad9..4a137a503c8a 100644 --- a/hw/riscv/virt.c +++ b/hw/riscv/virt.c @@ -254,7 +254,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;