From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0A66DC77B7A for ; Fri, 19 May 2023 03:51:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229880AbjESDvR (ORCPT ); Thu, 18 May 2023 23:51:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38600 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229452AbjESDvQ (ORCPT ); Thu, 18 May 2023 23:51:16 -0400 Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B0BD183; Thu, 18 May 2023 20:51:15 -0700 (PDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 75B4532008FB; Thu, 18 May 2023 23:51:13 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Thu, 18 May 2023 23:51:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm2; t= 1684468273; x=1684554673; bh=4ecmHSmtpaMehpa+G3raIzuSZ3nRd9Ghq9g 2WcWGtXY=; b=Bca11Fcs0kSlKYIPuv2YpWZ9GJJRanWjT8QE2bT0Rl366OooonO iD29iKWvvpkzT1JSrJbRnFsZ5m+UmL8k9A0fvgIr7j2a4B1rh76qwu1yJ0YphDgC syWHq3GrDemYVCOEXYQxUK8PjDGsqJxg+GxAP2RZMlCCfaaHsuj/wAsv7yLhP++N 0lxn5h1FAwWQexge6VGW03jLmiSIcynpU5+QAmZGdw5WOm3glHLjukxk0FQGGQ88 0Q1JV0SgpiGtpDyG5XVHKwCdxWVqevewoXEBAPCKGkIBaLIHu6uOeAgIAJLxNizG raSYXEphI8TmqvoM99ZNcz+EmFQipaeug2A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1684468273; x=1684554673; bh=4ecmHSmtpaMehpa+G3raIzuSZ3nRd9Ghq9g 2WcWGtXY=; b=D0UpIsf0zihnnkP/P9K6Em33imMuvchuQa4sj6g9N+CKDPtSYtD IXKWm9lIN0I7sKZs3okM40wy8Nm30Z2Z9GWLw0082toSBnE1ylShpsSb7UfZJ1j2 JOzqwtID67Kmtg5PRqUAHi1cveJR+GBTnXCPz9zkR8GFdPBf7VjWhN8EXpIKr6tt 1UwF1zrSin0CMupkbjzj7dcmUB9djZNhIOGrW4lbXTACecmdzi5c929YdSsMAIPh ACBUmHhGbMjgXfFD430xRBLOkUhDgI20KyaJdx/dJQ5fZBdVHnwfU6MFsKamVguP Qxtj8B7uB/8fYlDanKYsge1PGlezwAHlplg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfeeigedgjeeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfvfevfhfhufgjtgfgsehtjeertddtfeejnecuhfhrohhmpefurghm uhgvlhcujfholhhlrghnugcuoehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhgqeenuc ggtffrrghtthgvrhhnpeduueeugfelledugeeugedvgefghfevjefgieeljeevgeeihfff veeiffeivdekheenucffohhmrghinhepghhithhhuhgsrdgtohhmnecuvehluhhsthgvrh fuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepshgrmhhuvghlsehshhholhhl rghnugdrohhrgh X-ME-Proxy: Feedback-ID: i0ad843c9:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 18 May 2023 23:51:11 -0400 (EDT) Message-ID: Date: Thu, 18 May 2023 22:51:09 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux ppc64le; rv:102.0) Gecko/20100101 Thunderbird/102.3.3 Content-Language: en-US To: Jisheng Zhang Cc: linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, devicetree@vger.kernel.org, linux-serial@vger.kernel.org, Palmer Dabbelt , Thomas Gleixner , Marc Zyngier , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Palmer Dabbelt , Paul Walmsley , Albert Ou , Greg Kroah-Hartman , Jiri Slaby References: <20230518152244.2178-1-jszhang@kernel.org> <20230518152244.2178-8-jszhang@kernel.org> From: Samuel Holland Subject: Re: [PATCH v4 07/10] riscv: dts: bouffalolab: add the bl808 SoC base device tree In-Reply-To: <20230518152244.2178-8-jszhang@kernel.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org Hi Jisheng, On 5/18/23 10:22, Jisheng Zhang wrote: > Add a baisc dtsi for the bouffalolab bl808 SoC. > > Signed-off-by: Jisheng Zhang > Acked-by: Palmer Dabbelt > --- > arch/riscv/boot/dts/bouffalolab/bl808.dtsi | 73 ++++++++++++++++++++++ > 1 file changed, 73 insertions(+) > create mode 100644 arch/riscv/boot/dts/bouffalolab/bl808.dtsi > > diff --git a/arch/riscv/boot/dts/bouffalolab/bl808.dtsi b/arch/riscv/boot/dts/bouffalolab/bl808.dtsi > new file mode 100644 > index 000000000000..87906fe51db5 > --- /dev/null > +++ b/arch/riscv/boot/dts/bouffalolab/bl808.dtsi > @@ -0,0 +1,73 @@ > +// SPDX-License-Identifier: (GPL-2.0+ or MIT) > +/* > + * Copyright (C) 2022 Jisheng Zhang > + */ > + > +#include > + > +/ { > + compatible = "bouffalolab,bl808"; > + #address-cells = <1>; > + #size-cells = <1>; > + > + cpus { > + timebase-frequency = <1000000>; > + #address-cells = <1>; > + #size-cells = <0>; > + > + cpu0: cpu@0 { > + compatible = "thead,c906", "riscv"; > + device_type = "cpu"; > + reg = <0>; > + d-cache-block-size = <64>; > + d-cache-sets = <256>; > + d-cache-size = <32768>; > + i-cache-block-size = <64>; > + i-cache-sets = <128>; > + i-cache-size = <32768>; > + mmu-type = "riscv,sv39"; > + riscv,isa = "rv64imafdc"; > + > + cpu0_intc: interrupt-controller { > + compatible = "riscv,cpu-intc"; > + interrupt-controller; > + #address-cells = <0>; > + #interrupt-cells = <1>; > + }; > + }; > + }; > + > + xtal: xtal-clk { > + compatible = "fixed-clock"; > + #clock-cells = <0>; > + /* This value must be overridden by the board */ > + clock-frequency = <0>; > + }; > + > + soc { > + compatible = "simple-bus"; > + ranges; > + interrupt-parent = <&plic>; > + dma-noncoherent; > + #address-cells = <1>; > + #size-cells = <1>; > + > + uart3: serial@30002000 { > + compatible = "bouffalolab,bl808-uart"; > + reg = <0x30002000 0x1000>; > + interrupts = <20 IRQ_TYPE_LEVEL_HIGH>; > + clocks = <&xtal>; This isn't strictly accurate, and gives you the right frequency if you are using the vendor "low_load" bootloader. Without that (e.g. when loading U-Boot directly from the boot ROM), the routing is: MM_MUXPLL_160M / 1 => MM_BCLK1X MM_BCLK1X / 1 => MM_UART So this UART module clock is 160 MHz, not 40 MHz. The way to make this work reliably is to add drivers for the clock tree (from the preliminary work at [1][2], we'll need at least five of them), but that is a huge effort, so I'm not sure what we want to do for now. Regards, Samuel [1]: https://github.com/openbouffalo/u-boot/commit/3ca800850f30 [2]: https://github.com/openbouffalo/u-boot/commits/bl808/clk-reset > + status = "disabled"; > + }; > + > + plic: interrupt-controller@e0000000 { > + compatible = "bouffalolab,bl808-plic", "thead,c900-plic"; > + reg = <0xe0000000 0x4000000>; > + interrupts-extended = <&cpu0_intc 11>, <&cpu0_intc 9>; > + interrupt-controller; > + #address-cells = <0>; > + #interrupt-cells = <2>; > + riscv,ndev = <82>; > + }; > + }; > +};