Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9021659pxu; Mon, 28 Dec 2020 04:39:03 -0800 (PST) X-Google-Smtp-Source: ABdhPJwNiWQBAGuW1hhaG0/Jfmw+3itL9oa6+wibUsOrwoRdwLQskLyJiacbpC0KxFM83gL/NGku X-Received: by 2002:aa7:d407:: with SMTP id z7mr43913173edq.234.1609159143140; Mon, 28 Dec 2020 04:39:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609159143; cv=none; d=google.com; s=arc-20160816; b=GBTnNszohIpElaJwsV/FVelDZlzcu3ThTbtZeVXSTnm3RH5h1JARO8SpKYIoHt3V2M konqREX4s3e1ZKyCrCwaKTX5h68BtvXuP0LTMy+7eqSPVQFYHKEDVPnZVzBK/6Gfpk38 woDWznrKkYQuJmoU3ST1vKbIA+1mibCoq4Dsag13DAJTruq1yvSl8vi9a1iUkYxR/2H0 2SrxPdS+z0kysLmsOD0b6+l5oGGajP710ggWo5QOw615As4KLmXn69z/Tvg55CGgazdb lZqlPR5OVhVOJgDpxmpyboJPaahRiQDHep1ln5uo9ZkRqwpcwMgq4wkRCc9VMNHwXDR5 CpqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=DhsUhlUGmAXN4EXX9F3nlVv3tC7B658SwbZ+95FpGT4=; b=VWgFAL7AvnEsBkuErYi3NOgmSIpXuZx+6QKvfTMCjyELnip+CU2w+cMyyGx412mNOE Lzsh7M2lbOuG+g3XaDb+iuCqdWbfPUyNLn97gg/abrpuBId6zmT64yS6Ql+8ZJYqswua XoAOeM+eruabr9O8C5Jzlbzz1en1rqdK1xRiuqRDlptTNZ/GUxiR4ZATxDUQWQ2Q4/9K a2JxS9STwq8B4178yWgLtHOUXLrpiFbMwa+9b22X+pTFGHPhMX4NMMnDSOi0Ku4yGD4F /nE9McAAqwFtjxg0ZzYkbd3hyaAYlQYVjwzdZ0ffuqpxJeQ0JjI0FbldYUK9q1TxH6D5 4UzQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f12si22959980edx.584.2020.12.28.04.38.26; Mon, 28 Dec 2020 04:39:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727489AbgL1Me1 (ORCPT + 99 others); Mon, 28 Dec 2020 07:34:27 -0500 Received: from mail-oi1-f182.google.com ([209.85.167.182]:34686 "EHLO mail-oi1-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726420AbgL1Me0 (ORCPT ); Mon, 28 Dec 2020 07:34:26 -0500 Received: by mail-oi1-f182.google.com with SMTP id s75so11331752oih.1; Mon, 28 Dec 2020 04:34:10 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=DhsUhlUGmAXN4EXX9F3nlVv3tC7B658SwbZ+95FpGT4=; b=b1Z0fkOevfh7DpxR3c/IpSgdBWwBxC5KOwEuR0SPHmeFpnXPPidwv6gGGi7xIxmq7q U8m7hVmD3Qb73R7zM01SHNwbNm1kt0yP7OIm+botPj02nr+eVYYhmkF1PU0gBBnUy+Gj rQPhUgWcCpFq/fIpzn0d6omRU3h1MlcgNv4H8jNozhffijzHEulc7KSIDKwH07gqFeZQ 3sCueKtMx2diUL2ozWyjU46h7/NnUg3z2fZrIe2jpzfLt1Jl4vp4R68pCxg/KCwXi0LU G5qLoNG1OZvcBsO7NPUsh38B6MaLoCo6k9kNTCGXQlyjqdA2AdoHAK4uRhIVOUNZea5s 6Wig== X-Gm-Message-State: AOAM532F73mVkOUCBBtZ0+DlCP2d3xLrw4GQ+CA8yplvtUI0aD24iw2h HLrc3d0ERGEc6D4v8J9e5EltMIXQUSC2EwYZUno= X-Received: by 2002:aca:ec09:: with SMTP id k9mr11722486oih.153.1609158825156; Mon, 28 Dec 2020 04:33:45 -0800 (PST) MIME-Version: 1.0 References: <20201213183759.223246-1-aford173@gmail.com> <20201213183759.223246-2-aford173@gmail.com> In-Reply-To: From: Geert Uytterhoeven Date: Mon, 28 Dec 2020 13:33:34 +0100 Message-ID: Subject: Re: [PATCH 01/18] arm64: dts: renesas: beacon kit: Configure programmable clocks To: Adam Ford Cc: Linux-Renesas , Adam Ford-BE , Magnus Damm , Rob Herring , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Linux Kernel Mailing List , Luca Ceresoli , Yoshihiro Shimoda Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Adam, On Thu, Dec 24, 2020 at 2:53 PM Adam Ford wrote: > On Tue, Dec 22, 2020 at 2:03 AM Geert Uytterhoeven wrote: > > On Tue, Dec 22, 2020 at 2:39 AM Adam Ford wrote: > > > On Fri, Dec 18, 2020 at 7:16 AM Geert Uytterhoeven wrote: > > > > On Thu, Dec 17, 2020 at 12:52 PM Adam Ford wrote: > > > > > On Thu, Dec 17, 2020 at 2:16 AM Geert Uytterhoeven wrote: > > > > > > On Wed, Dec 16, 2020 at 6:03 PM Adam Ford wrote: > > > > > > > On Wed, Dec 16, 2020 at 8:55 AM Geert Uytterhoeven wrote: > > > > > > > > On Sun, Dec 13, 2020 at 7:38 PM Adam Ford wrote: > > > > > > > > > When the board was added, clock drivers were being updated done at > > > > > > > > > the same time to allow the versaclock driver to properly configure > > > > > > > > > the modes. Unforutnately, the updates were not applied to the board > > > > > > > > > > > > > > > --- a/arch/arm64/boot/dts/renesas/beacon-renesom-baseboard.dtsi > > > > > > > > > +++ b/arch/arm64/boot/dts/renesas/beacon-renesom-baseboard.dtsi > > > > > > > > > @@ -5,6 +5,7 @@ > > > > > > > > > > > > > > > > > > #include > > > > > > > > > #include > > > > > > > > > +#include > > > > > > > > > > > > > > > > > > / { > > > > > > > > > backlight_lvds: backlight-lvds { > > > > > > > > > @@ -294,12 +295,12 @@ &du_out_rgb { > > > > > > > > > &ehci0 { > > > > > > > > > dr_mode = "otg"; > > > > > > > > > status = "okay"; > > > > > > > > > - clocks = <&cpg CPG_MOD 703>, <&cpg CPG_MOD 704>; > > > > > > > > > + clocks = <&cpg CPG_MOD 703>, <&cpg CPG_MOD 704>, <&versaclock5 3>; > > > > > > > > > > > > > > > > Why this change? You said before you don't need this > > > > > > > > https://lore.kernel.org/linux-renesas-soc/CAHCN7xJWbP16SA-Ok-5syNnqOZAt8OFJo2_rtg5VrNVsN2-eiQ@mail.gmail.com/ > > > > > > > > > > > > > > > > > > > > > > I had talked with the hardware guys about buy pre-programmed > > > > > > > versaclock chips which would have been pre-configured and pre-enabled. > > > > > > > I thought it was going to happen, but it didn't, so we need the > > > > > > > versaclock driver to enable the reference clock for the USB > > > > > > > controllers, ethernet controller and audio clocks. Previously we were > > > > > > > manually configuring it or it was coincidentally working. Ideally, > > > > > > > we'd have the clock system intentionally enable/disable the clocks > > > > > > > when drivers are loaded/unloaded for for power management reasons. > > > > > > > > > > > > Can you tell me how exactly the Versaclock outputs are wired? > > > > > > > > > > The SoC is expecting a fixed external 50 MHz clock connected to > > > > > USB_EXTAL. Instead of a fixed clock, we're using the Versaclock. > > > > > We're also using the Versaclock to drive the AVB TXCRefClk, > > > > > du_dotclkiun0 and du_dotclkin2 (also also called du_dotclkin3 on > > > > > RZ/G2N) instead of fixed clocks. > > > > > > > > > > > E.g. for USB, the bindings don't say anything about a third clock input, > > > > > > so I'd like to know where that clock is fed into USB. > > > > > > > > > > The way the driver is crafted, it can take in multiple clocks and it > > > > > goes through a list to enable them all, so I added the versaclock to > > > > > the array. Without the versaclock reference, the clock doesn't get > > > > > turned on and the USB fails to operate. > > > > > > > > According to the Hardware User's Manual, USBL_EXTAL is used for USB3.0, > > > > while you added the clock references to the EHCI nodes. > > > > Are you sure EHCI is failing without this? > > I talked to a colleague about the USB_EXTAL. He pointed me to table > 60.1 of the RZ/2 Series, 2nd Generate reference manual > (R01UH0808EJ0100 Rev.1.00), which shows the USB EHCI needing the > 50MHz. When I clear out the references from ehci0 and echi1, the USB > stops working, so it does appear that using the versaclock as the 3rd > clock is needed for operating. The device tree bindings for the > generic-ehci provide for up to 4 clocks, so it seems like referencing > clocks = <&cpg CPG_MOD 703>, <&cpg CPG_MOD 704>, <&versaclock5 3> are > not a violation of the bindings. Perhaps you need to use renesas,rcar-usb2-clock-sel? Documentation/devicetree/bindings/clock/renesas,rcar-usb2-clock-sel.yaml Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds