From nobody Mon Feb 9 15:10:55 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1565511457; cv=none; d=zoho.com; s=zohoarc; b=dthfdknX6tS/iBy6/zLphUDriXmOpTYZUqSr1hgqm1HluhkLENE0q9DpqnL5mQiTsW1YjtXmy7zzVmFJDdefsjHKztqN2YuTlqi4n36c3SS6tfaiOVu6yfxgbbPOBQKhsRULzC7zIlIOTzIlBbCEDxbpUq8Uhycw8Pk5FO6K2wc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1565511457; h=Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=pf6iyW4D6ylluzsEL2WnqoH6nuzAdNyXzAQ0//xR7/Q=; b=ZAxeotUvRZV2SrHV6bUUKCiGgOy6rCCRnDC1KifA/yjlK2rbudZBWMSGZsI8s4G0zHQ7kvOcGha/YvARCXCES9b3JUy6c4uOgqnDmAdo+N4e9fD9ebh5nVsSFQkj3cnHpzmNDEs6A8VomV2PhRco09cN6qFYn24ym/m5QoqJKgA= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1565511457076200.97647845792812; Sun, 11 Aug 2019 01:17:37 -0700 (PDT) Received: from localhost ([::1]:39442 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hwj2m-0004TN-2x for importer@patchew.org; Sun, 11 Aug 2019 04:17:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60511) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hwit5-0006i5-Uy for qemu-devel@nongnu.org; Sun, 11 Aug 2019 04:07:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hwit4-00047j-Se for qemu-devel@nongnu.org; Sun, 11 Aug 2019 04:07:35 -0400 Received: from mail-pl1-x641.google.com ([2607:f8b0:4864:20::641]:46547) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hwit4-000473-Mu; Sun, 11 Aug 2019 04:07:34 -0400 Received: by mail-pl1-x641.google.com with SMTP id c2so46684673plz.13; Sun, 11 Aug 2019 01:07:34 -0700 (PDT) Received: from localhost.localdomain (unknown-224-80.windriver.com. [147.11.224.80]) by smtp.gmail.com with ESMTPSA id v8sm87339107pgs.82.2019.08.11.01.07.33 (version=TLS1 cipher=AES128-SHA bits=128/128); Sun, 11 Aug 2019 01:07:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references; bh=pf6iyW4D6ylluzsEL2WnqoH6nuzAdNyXzAQ0//xR7/Q=; b=iQloIMvA9uLT6mCyszeBlmjjMYlbUmJTWIEuU9RZEhDi1IYJvl17WFTKmSGdZ6xxlX E8g2ujanNOr+w+Nviwc4/IYD78jTEIDgxdiTS0KzlmRPazMqM6C8gU34Y62Htd/dNvb7 epStjxFEYOSCdgBqtY0opovVZbwTOS47Esbiw26D8KNIOhVYhZhOtBBdVaI3G4b6VVOx CupRgIQbujtP8ahBUA95bEcRa4mnaiqg/pGR1obZkvxW9eCxxCmei8GELKi3WJnIUQsE ApzjdmWfYhQyiGRnX1zopmMoixNBXNy+xmqwpeATVWRT2wBBsGowquQpfssFBdHYiqrY edhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=pf6iyW4D6ylluzsEL2WnqoH6nuzAdNyXzAQ0//xR7/Q=; b=GnF84tctg0Zrxo/JjiMuu45D/VDiZ9ruEdbLHyfjymKYI4G8tf0+FuFzGmcZLqPxec C1Yi60QO516JWAF4JlHNwzav0DMrtPKUXMyPHx5Gi25zeRg221mw9VTOEwquyd/Zy0WN G6cs4/zh5Dj+eDWNyOkne283pNi5CJpKGM5kzyiFqAV7ShY84tv/TfdR64CBKCcbuZrn rYylVRSAip5pTFaWTENoac6/5rBRpCzPL2LidJTfoC756gNE+mDKHkthAbLo9N0wysoW mGk+6jL29SKCTE+58sia0sTOSsC29oOjgLArr2G8F7lbfBb63n6oDOZq7vcLFi+KGdE2 ppcA== X-Gm-Message-State: APjAAAXtsdCXtcDi4I4qH135vXPB0x3l77CpNn97+Au41QyKdIFKj7sg tArNLUtt2CLkcjjnkanS4sE= X-Google-Smtp-Source: APXvYqybGKEdfGqAyCvITaL7Hp1Xw+DjX8pZXr1Mzm8R495Wu9E48h3XvlL80CQ2A/pTW/5X0NjhIQ== X-Received: by 2002:a17:902:4222:: with SMTP id g31mr28519934pld.41.1565510854044; Sun, 11 Aug 2019 01:07:34 -0700 (PDT) From: Bin Meng To: Alistair Francis , Palmer Dabbelt , qemu-devel@nongnu.org, qemu-riscv@nongnu.org Date: Sun, 11 Aug 2019 01:06:57 -0700 Message-Id: <1565510821-3927-25-git-send-email-bmeng.cn@gmail.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1565510821-3927-1-git-send-email-bmeng.cn@gmail.com> References: <1565510821-3927-1-git-send-email-bmeng.cn@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::641 Subject: [Qemu-devel] [PATCH v3 24/28] riscv: sifive_u: Support loading initramfs X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The loading of initramfs is currently not supported on 'sifive_u'. Add the support to make '-initrd' command line parameter useful. Signed-off-by: Bin Meng Reviewed-by: Chih-Min Chao Reviewed-by: Alistair Francis --- Changes in v3: None Changes in v2: None hw/riscv/sifive_u.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/hw/riscv/sifive_u.c b/hw/riscv/sifive_u.c index e8bef44..b0026aa 100644 --- a/hw/riscv/sifive_u.c +++ b/hw/riscv/sifive_u.c @@ -328,7 +328,18 @@ static void riscv_sifive_u_init(MachineState *machine) memmap[SIFIVE_U_DRAM].base); =20 if (machine->kernel_filename) { - riscv_load_kernel(machine->kernel_filename); + uint64_t kernel_entry =3D riscv_load_kernel(machine->kernel_filena= me); + + if (machine->initrd_filename) { + hwaddr start; + hwaddr end =3D riscv_load_initrd(machine->initrd_filename, + machine->ram_size, kernel_entry, + &start); + qemu_fdt_setprop_cell(s->fdt, "/chosen", + "linux,initrd-start", start); + qemu_fdt_setprop_cell(s->fdt, "/chosen", "linux,initrd-end", + end); + } } =20 /* reset vector */ --=20 2.7.4