From patchwork Fri Dec 21 16:02:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Palmer Dabbelt X-Patchwork-Id: 10740681 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 60ED514DE for ; Fri, 21 Dec 2018 16:18:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4F98A284E9 for ; Fri, 21 Dec 2018 16:18:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 439D2284F0; Fri, 21 Dec 2018 16:18:31 +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 E637E284E9 for ; Fri, 21 Dec 2018 16:18:30 +0000 (UTC) Received: from localhost ([::1]:46503 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gaNVO-000728-5O for patchwork-qemu-devel@patchwork.kernel.org; Fri, 21 Dec 2018 11:18:30 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53018) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gaNHO-0001fT-Si for qemu-devel@nongnu.org; Fri, 21 Dec 2018 11:04:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gaNHN-0004Ew-J8 for qemu-devel@nongnu.org; Fri, 21 Dec 2018 11:04:02 -0500 Received: from mail-qt1-x842.google.com ([2607:f8b0:4864:20::842]:41917) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gaNHN-00046f-6M for qemu-devel@nongnu.org; Fri, 21 Dec 2018 11:04:01 -0500 Received: by mail-qt1-x842.google.com with SMTP id l12so6163727qtf.8 for ; Fri, 21 Dec 2018 08:03:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=subject:date:message-id:in-reply-to:references:cc:from:to; bh=s8TQWdfmNT9BwGooMFuCxfyNF1ywYtDH9Swp6HiUmKk=; b=HmnWOGrhMrl296xxyVHR+r175c/qLnVAdcPreioVdik2VoHJIT4bgodSzT5AQc+dIn FHr20ZFfc6xY1NM5pCHlVDfwGw5Lc9+tlC3jUV6GOa6mNtUZsQJYRKa54EMOFzo4po5R WyLcmqT4eeC7ycC0FkSeQmypiwJrjAC9NpSgCqf5Tt+ME9xSReBbJd0DTN+9XGNF9sl5 TgRoqJsodZYkZKFn1CjmEgxQO7su2gatE9W2Q9+uK1iilvkkYoapajhtVUwRqMO8sbXa CpHF4XixvbwkJyHwh1o21gI+J1Ou2SkcAmk4Fhpa3cSR4TCcPjSq0gqHoca78/jy6fDA bM+A== 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 :cc:from:to; bh=s8TQWdfmNT9BwGooMFuCxfyNF1ywYtDH9Swp6HiUmKk=; b=ZC1kNLy3wkPfGuFnRXR0tZblCnlIBVY+1IJCQ31p6A4Rq5s84TJC0VpkYvCxyDJDQB 7oXqwbZ8mRPmtAQPWWGUHEFvGoyg7QJ2fh92yFGnW7fMxyj7RhXYT62OqiALio0UqbXh XRFZxWLlGo/RycNZBv6/ruiPv5za/GLo8BSVf8vzIIq87pU6ycBE/WXFWawgmfA2xGyE t6UKUwIQudEBLNNoJmznCDOl2sPdBJdWG0iV43blFBXxDLQuO9tGYUKIdmLCIyZ9ladt bgXsPBhmtAegFojHyYbtbmSRCFx4Mx6ePRx16AzBN/+hZXZnzxHR5n2wnJX6p7w73YsT ZIYA== X-Gm-Message-State: AJcUukctxxK/lAaAP3JtcblBblQLd8GCQ6yz089Itr2w0lQZqtFBSUeF V+BxhwFqXpTLdLAHfOPIUuYGVfu7/Zs= X-Google-Smtp-Source: ALg8bN6y1K1+8ngKd5jTVguehXr0Jqg/CjM30bnW8hLqwiIsKopWNTOgbH0Prpbah4/2+hRGWeUYTA== X-Received: by 2002:a0c:f8cb:: with SMTP id h11mr3041515qvo.134.1545408223949; Fri, 21 Dec 2018 08:03:43 -0800 (PST) Received: from localhost ([2601:182:c980:96c:8dd:4488:90b1:59d1]) by smtp.gmail.com with ESMTPSA id o21sm6057974qto.18.2018.12.21.08.03.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 21 Dec 2018 08:03:43 -0800 (PST) Date: Fri, 21 Dec 2018 08:02:59 -0800 Message-Id: <20181221160307.14819-7-palmer@sifive.com> X-Mailer: git-send-email 2.18.1 In-Reply-To: <20181221160307.14819-1-palmer@sifive.com> References: <20181221160307.14819-1-palmer@sifive.com> From: Palmer Dabbelt To: qemu-riscv@nongnu.org X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::842 Subject: [Qemu-devel] [PULL 06/14] sifive_u: Set 'clock-frequency' DT property for SiFive UART 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: Anup Patel , Anup Patel , 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: Anup Patel The 'clock-frequency' DT property is required by U-Boot to compute the divider value. This patch sets the 'clock-frequency' DT property of the SiFive UART device tree node (similar to virt machine). Signed-off-by: Anup Patel Signed-off-by: Anup Patel Signed-off-by: Alistair Francis Reviewed-by: Palmer Dabbelt Signed-off-by: Palmer Dabbelt --- hw/riscv/sifive_u.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/riscv/sifive_u.c b/hw/riscv/sifive_u.c index 5c41ee5017e4..849fa2e6311a 100644 --- a/hw/riscv/sifive_u.c +++ b/hw/riscv/sifive_u.c @@ -241,6 +241,8 @@ static void create_fdt(SiFiveUState *s, const struct MemmapEntry *memmap, qemu_fdt_setprop_cells(fdt, nodename, "reg", 0x0, memmap[SIFIVE_U_UART0].base, 0x0, memmap[SIFIVE_U_UART0].size); + qemu_fdt_setprop_cell(fdt, nodename, "clock-frequency", + SIFIVE_U_CLOCK_FREQ / 2); qemu_fdt_setprop_cells(fdt, nodename, "interrupt-parent", plic_phandle); qemu_fdt_setprop_cells(fdt, nodename, "interrupts", 1);