Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp1164899rwa; Sun, 21 Aug 2022 02:31:31 -0700 (PDT) X-Google-Smtp-Source: AA6agR6+nhTkn4Aj6G9drgtoZBYEwuXLIpG/7SI3maV0BWOlDVZEHOkP8wZdfPrTCvc+yA46hO96 X-Received: by 2002:a05:6402:2714:b0:43d:ca4f:d2a2 with SMTP id y20-20020a056402271400b0043dca4fd2a2mr12338863edd.185.1661074291078; Sun, 21 Aug 2022 02:31:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661074291; cv=none; d=google.com; s=arc-20160816; b=qCu3xXf4WoSxwH4idnwsjkiD0DhZpG6ctmMKzCNEcWP78jMwdcdPmKhTtFWS34eLvG dVTqn4jjWvlO8KJyVzrrvtx/nIPswy1eE0ju7ZYCVzeWrL2IuyrlQT/7MHv5q2Y9T7qj i4DLw+mKmgm0F0psqLmuuSDPY2iHBGo4qE+63Pw1cfwhlm5kZLRm/aEflC8bdIeVybFi M0Q3/8z/dXYXSjZ9IFqyuRZB5+ivStMjtFrOdYMf3vc45wPZN/bWOJ+Vn8YBXZXosJh6 5LB0bZJoIx4E3l4Y2PPu8fi4OAVIot29cX9Ez1BucAABUtTLjLoG4YoXwtd11Gav2pOQ E4mA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date:dkim-signature; bh=tcJGD6PTZs1fy7fp/sHwlwAKDI/0aDFPfy+glUb7evo=; b=BTL/kkLEzjr5wuVAVMLugFYDSvv0uSkTmdPYKE/iWyY3aenzLOO8Bey51Tajdrdca8 i1K/kFMoBD9yPhQqksWYoTv9cApV8y66/YXIFludLnMjyCZKmNeYD5IRkcpLiDvwDqHN xkk3zVe644KKL41KcN4d2fwmFmejV5GaSUHBhmSsLHCXl0NI3iVH0hYjwHevM1YJa7OK Zu4OAIAe/P5gevB5glWKMRVQxhf6AgHiFYHqmg3HrRFrH7wyABK4d4xDMBICmu2BWTka hhFXUEws3B8x+kEYNwR6jZrKchl5qwun6KBxaSy3serQILOMwiyp44otO4ft1EMunukK jBGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@xff.cz header.s=mail header.b=omGMGkba; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=xff.cz Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k14-20020aa7d2ce000000b0043e62aa41c5si6249378edr.616.2022.08.21.02.30.38; Sun, 21 Aug 2022 02:31:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@xff.cz header.s=mail header.b=omGMGkba; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=xff.cz Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229818AbiHUJAO (ORCPT + 99 others); Sun, 21 Aug 2022 05:00:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229484AbiHUJAN (ORCPT ); Sun, 21 Aug 2022 05:00:13 -0400 Received: from vps.xff.cz (vps.xff.cz [195.181.215.36]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6EF1029C97; Sun, 21 Aug 2022 02:00:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=xff.cz; s=mail; t=1661072405; bh=ynJQrqcBA9pxR9yUbyxuuuDFYSKz2yTPBE1A5rCk+mA=; h=Date:From:To:Cc:Subject:X-My-GPG-KeyId:References:From; b=omGMGkba3UMpAQ8gwj4+7Dk42+KAOtRtaobizJUb0ORoBQVFC0PeROZOE2gyxxRLg IfQZYNErFxS2lkmZWxzYR1AsoGLdEvV72/uxGXTIOYD8BbnNQhy/8YtgawDIJGURxG KvZ6VUp5IGjI7Hw+vqLcSbsTwl68c/FUhOJcdAXA= Date: Sun, 21 Aug 2022 11:00:05 +0200 From: =?utf-8?Q?Ond=C5=99ej?= Jirman To: =?utf-8?B?TsOtY29sYXMgRi4gUi4gQS4=?= Prado Cc: Tom Fitzhenry , robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, heiko@sntech.de, martijn@brixit.nl, ayufan@ayufan.eu, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, phone-devel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 2/2] arm64: dts: rockchip: Add initial support for Pine64 PinePhone Pro Message-ID: <20220821090005.tshf7z2kklaet7ll@core> Mail-Followup-To: =?utf-8?Q?Ond=C5=99ej?= Jirman , =?utf-8?B?TsOtY29sYXMgRi4gUi4gQS4=?= Prado , Tom Fitzhenry , robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, heiko@sntech.de, martijn@brixit.nl, ayufan@ayufan.eu, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, phone-devel@vger.kernel.org, linux-kernel@vger.kernel.org X-My-GPG-KeyId: EBFBDDE11FB918D44D1F56C1F9F0A873BE9777ED References: <20220815123004.252014-1-tom@tom-fitzhenry.me.uk> <20220815123004.252014-3-tom@tom-fitzhenry.me.uk> <20220818030547.eblbmchutmnn6jih@notapiano> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20220818030547.eblbmchutmnn6jih@notapiano> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Nícolas, On Wed, Aug 17, 2022 at 11:05:47PM -0400, Nícolas F. R. A. Prado wrote: > Hi Tom, > > thanks for getting the upstreaming of this DT going. Some comments below. > > On Mon, Aug 15, 2022 at 10:30:04PM +1000, Tom Fitzhenry wrote: > > From: Martijn Braam > > > > This is a basic DT containing regulators and UART, intended to be a > > base that myself and others can add additional nodes in future patches. > > > > Tested to work: booting from eMMC, output over UART. > > You're also adding the SD controller here. Does it work as is? If so add it to > the commit description as well. > > > > [..] > > --- /dev/null > > +++ b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts > > @@ -0,0 +1,394 @@ > > +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) > > +/* > > + * Copyright (c) 2020 Martijn Braam > > + * Copyright (c) 2021 Kamil Trzciński > > + */ > > + > > +/* PinePhone Pro datasheet: > > First comment line should be empty following the coding style [1]. Like you did > for the copyrights above. > > [1] https://www.kernel.org/doc/html/latest/process/coding-style.html#commenting > > > + * https://files.pine64.org/doc/PinePhonePro/PinephonePro-Schematic-V1.0-20211127.pdf > > + */ > [..] > > + vcc_sysin: vcc-sysin-regulator { > > + compatible = "regulator-fixed"; > > + regulator-name = "vcc_sysin"; > > This signal is called vcc_sys in the datasheet, so I suggest we keep that name > here. It's not everyday that we get a device with a publicly available datasheet > :^). > > > + regulator-always-on; > > + regulator-boot-on; > > + }; > [..] > > + rk818: pmic@1c { > > + compatible = "rockchip,rk818"; > > + reg = <0x1c>; > > + interrupt-parent = <&gpio1>; > > + interrupts = ; > > + #clock-cells = <1>; > > + clock-output-names = "xin32k", "rk808-clkout2"; > > What about keeping the datasheet names here too? clk32kout1, clk32kout2 Rather not. My guess is that trying to change the names will break the clock tree, because xin32k is hardcoded in the rk3399 clk driver as parent for mux_pll_p. https://elixir.bootlin.com/linux/latest/source/drivers/clk/rockchip/clk-rk3399.c#L109 These names are not just a cosmetic thing. > > > + pinctrl-names = "default"; > [..] > > + vcc_1v8: vcc_wl: DCDC_REG4 { > > From the datasheet, vcc_wl is actually wired to vcc3v3_sys. But looks like > vcc_wl is only used for bluetooth and you're not enabling it yet anyway, so just > drop this extra label, and it can be added when bluetooth is added (or not, and > then the bluetooth supply just points directly to vcc3v3_sys). > > > + regulator-name = "vcc_1v8"; > [..] > > + vcc_power_on: LDO_REG4 { > > + regulator-name = "vcc_power_on"; > > The name on the datasheet for this one is rk818_pwr_on. > > > + regulator-always-on; > [..] > > +&cluster0_opp { > > + opp04 { > > + status = "disabled"; > > + }; > > + > > + opp05 { > > + status = "disabled"; > > + }; > > +}; > > I saw the discussion on the previous version about using the rk3399-opp.dtsi > here, but the thing is, this OPP has greater values for the max voltage than the > maximum allowed on the OPP table you posted previously (for RK3399-T)... Max voltages in OPP table are irreleavant for Pinephone Pro DT, because the CPU regulators in the PMIC are capable of setting the preferred voltage or very close to it. The actual min/max limits that are enforced by the kernel for the board are set on the CPU regulator, which are actually wrongly set in this DT. See: https://dl.radxa.com/rockpi4/docs/hw/datasheets/Rockchip%20RK3399-T%20Datasheet%20V1.0-20210818.pdf + vdd_cpu_l: DCDC_REG1 { + regulator-name = "vdd_cpu_l"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <750000>; + regulator-max-microvolt = <1350000>; Should be 975000 (or at most 1300000 to fit within absmax) + regulator-ramp-delay = <6001>; + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + vdd_cpu_b: regulator@40 { + compatible = "silergy,syr827"; + reg = <0x40>; + fcs,suspend-voltage-selector = <1>; + pinctrl-names = "default"; + pinctrl-0 = <&vsel1_pin>; + regulator-name = "vdd_cpu_b"; + regulator-min-microvolt = <712500>; + regulator-max-microvolt = <1500000>; + regulator-ramp-delay = <1000>; + regulator-always-on; + regulator-boot-on; + + regulator-state-mem { + regulator-off-in-suspend; + }; + }; Should be 1150000 (or at most 1300000 to fit within absmax) + vdd_gpu: regulator@41 { + compatible = "silergy,syr828"; + reg = <0x41>; + fcs,suspend-voltage-selector = <1>; + pinctrl-names = "default"; + pinctrl-0 = <&vsel2_pin>; + regulator-name = "vdd_gpu"; + regulator-min-microvolt = <712500>; + regulator-max-microvolt = <1500000>; Should be 975000 (or at most 1300000 to fit within absmax) + regulator-ramp-delay = <1000>; + regulator-always-on; + regulator-boot-on; + + regulator-state-mem { + regulator-off-in-suspend; + }; + }; The max values in OPP table also still fit within abs. max values for RK3399-T, so they are safe in any case. > Same thing for the GPU OPP. > > > + > > +&cluster1_opp { > > + opp06 { > > + status = "disabled"; > > + }; > > There's actually an opp06 node in the OPP for RK3399-T, only that the frequency > is slightly lower. Maybe you could keep it enabled but override the frequency? > > Or given the above point about the max voltages, maybe it would be best to have > a separate OPP table after all? No separate OPP table, please, unless absolutely necessary. kind regards, Ondrej > > + > > + opp07 { > > + status = "disabled"; > > + }; > > +}; > > + > > +&io_domains { > > + status = "okay"; > > Let's keep the status at the end of the node for consistency with the rest. > > With these points addressed: > > Reviewed-by: Nícolas F. R. A. Prado > > I'll also try to give this a test shortly. > > Thanks, > Nícolas > > > + > > + bt656-supply = <&vcc1v8_dvp>; > > + audio-supply = <&vcca1v8_codec>; > > + sdmmc-supply = <&vccio_sd>; > > + gpio1830-supply = <&vcc_3v0>; > > +}; > [..]