From mboxrd@z Thu Jan 1 00:00:00 1970 From: Oleksij Rempel Subject: Re: [PATCH v2 4/6] dt: bindings: add mt7621-pll dt binding documentation Date: Sat, 17 Aug 2019 17:39:52 +0200 Message-ID: <2d48f4a4-7d30-547b-21ee-6aadabe7d7c3@gmx.net> References: <20190724022310.28010-1-gch981213@gmail.com> <20190724022310.28010-5-gch981213@gmail.com> <20190813155143.GA19830@bogus> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org To: Chuanhong Guo , Rob Herring Cc: "open list:COMMON CLK FRAMEWORK" , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , open list , "open list:MIPS" , "open list:STAGING SUBSYSTEM" , Michael Turquette , Stephen Boyd , Mark Rutland , Ralf Baechle , Paul Burton , James Hogan , John Crispin , Greg Kroah-Hartman , Weijie Gao , NeilBrown List-Id: devicetree@vger.kernel.org Hi, Am 17.08.19 um 16:42 schrieb Chuanhong Guo: > Hi! > > On Tue, Aug 13, 2019 at 11:51 PM Rob Herring wrote: >> [...] >>> +Example: >>> + pll { >>> + compatible =3D "mediatek,mt7621-pll"; >> >> You didn't answer Stephen's question on v1. > > I thought he was asking why there's a syscon in compatible string. I > noticed that the syscon in my previous patch is a copy-paste error > from elsewhere and dropped it. > >> >> Based on this binding, there is no way to control/program the PLL. Is >> this part of some IP block? > > The entire section is called "system control" in datasheet and is > occupied in arch/mips/ralink/mt7621.c [0] > Two clocks provided here is determined by reading some read-only > registers in this part. > There's another register in this section providing clock gates for > every peripherals, but MTK doesn't provide a clock plan in their > datasheet. I can't determine corresponding clock frequencies for every > peripherals, thus unable to write a working clock driver. In provided link [0] the ralink_clk_init function is reading SYSC_REG_CPL= L_CLKCFG0 R/W register. This register is used to determine clock source, clock freq and CPU or bu= s clocks. SYSC_REG_CPLL_CLKCFG1 register is a clock gate controller. It is used to e= nable or disable clocks. Jist wild assumption. All peripheral devices are suing bus clock. IMO - this information is enough to create full blown drivers/clk/mediatek= /clk-mt7621.c >>> + >>> + #clock-cells =3D <1>; >>> + clock-output-names =3D "cpu", "bus"; >>> + }; >>> -- >>> 2.21.0 >>> > > Regards, > Chuanhong Guo > > [0] https://elixir.bootlin.com/linux/latest/source/arch/mips/ralink/mt76= 21.c#L156 >