Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9102803pxu; Mon, 28 Dec 2020 06:42:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJwJkkzWuflYv/G9wYTx3jmvld/i9q3Vj7EJy9Jm2/eisMheXHHaJweG4bs+tcOPh25LBhz2 X-Received: by 2002:a17:906:fa82:: with SMTP id lt2mr41790753ejb.322.1609166544457; Mon, 28 Dec 2020 06:42:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609166544; cv=none; d=google.com; s=arc-20160816; b=goJtSB+Ll1JTBuFnSEukTa7UUEJN0zONEYKr/y1+tDm8zuPi6KHyXas2IO1kIf1Ft6 jvJG2AnSrRzF6eDIPeX8Np78xE1WKq8u9Eg2cT+AiEgJ81qWoS/UWRoUBXIQr33J4MJX +c2J/KZCurZfZ3GC90VoTByCuIWK8Ov3/XRpaLFyGZmyvel5+pMZI1ZEU+sDw8vShV/5 gapASm7lYRISm15PG9oxUTHcm+d2IfHhZGI9tO2G2YEgm8D1hMUTRFq2p1uNC0sUttJb CJER12/jqqjYd3IVm4/Ow6Lwb2WQeiGeUc1xr7b3BlODJzxCYda33yBibNVdY/ANtk5S Vi8g== 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:dkim-signature; bh=aURPYtA3lpG+7e0e4HidMNiG4zYD+7X05J1ucN2OsKw=; b=hBy0TjxtXEIzWAq24mnxkrk3xIFpRXpVzESYu+umlqiZ9wwuBhEQhUEIGFf6bYv2hV cEeIhIhyKw9y+4/HPYFdiz0sOFtTcLpmw2iFxmWUaM3RluHcTNg2kiSzM9xtWwzFjs5W 0WU9P/4ZtoBoxm7uA1G2jfmKVA2CxcNGtRApw+bC8WuQWOffmVz2sNQ6KtTs5ZRYLtk/ mOyAHCnsYz+xpkxlo3xe72awMhD7Oebw05Ta10HYI8m3pGlgogwaPB/52IQh/CFK9Hsd 7vFwBwIrHJ5kb98JjlVJQlKWye6uLdO4s65XZZGJjz3wKuMhfdA/uI7K3ddI392KY3H4 uRwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=OmS8mazg; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k2si22099337edf.160.2020.12.28.06.42.01; Mon, 28 Dec 2020 06:42:24 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=OmS8mazg; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2505775AbgL1Ojz (ORCPT + 99 others); Mon, 28 Dec 2020 09:39:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34998 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2505756AbgL1Ojw (ORCPT ); Mon, 28 Dec 2020 09:39:52 -0500 Received: from mail-il1-x133.google.com (mail-il1-x133.google.com [IPv6:2607:f8b0:4864:20::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A69DEC061795; Mon, 28 Dec 2020 06:39:11 -0800 (PST) Received: by mail-il1-x133.google.com with SMTP id 2so9602720ilg.9; Mon, 28 Dec 2020 06:39:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=aURPYtA3lpG+7e0e4HidMNiG4zYD+7X05J1ucN2OsKw=; b=OmS8mazgyq9xAou1z6fMdsjY0v6XDZy2umiTInuR2Ze8Ys7UuVNx2R23Oxes1GD5xH 6nNECex5i0YMeQl6l8AeIPDrPruXfP+ljmChEmEwmdvJgCW1KolwovNATZszPggB6GRW rw9svx/RDLrcT9tLWD6TXQ7Y3RXVODXwW9ZfKkMOM8HmgPGq2tb5WSe2JH0wwtVS+B40 klCMmV8pxFCiL9D5+xn/f96/YmEAbE1Z7/t6huI5aLe7S3fgimTAYxFR40AE4EYLqnVI RyXCy7z3Q0UtZSfLSRAHAR9PNKWxK2C9gMNrnY76Q5A94dOEehhY/B2TDm2TWrhQzahg GrTw== 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=aURPYtA3lpG+7e0e4HidMNiG4zYD+7X05J1ucN2OsKw=; b=JF6CPFU0H3ywZM3gWLwAUQAMb2F5L2Xu6BcA/knAoRXNJmdTctDEpNwLQ7BRuglRD1 oYUSLJZa54VK7j1oOLrTFS5d2K33lgrDjCgD8hnRApkDt1AnKbvcXiZ57hK+Cw4v30zc iCuoaCihGw7hCP9x+d86kz8ICtKQrOGplYT5esnPYM10FM47BA86X2DMcpBJq7/tfH6T qQSJlIYwNgkEQsI+q9GBsiyRZOeGykI2gf7tIz/nbkNHWnROYZ4QjI0U9pfu6kWQ68Nu W3T/m1U/cnT9NrttK7l3nm0Wb9ezdS3yz3fqWz0XhGMp5yPuXwXei/6KeFofR63y6nnd putw== X-Gm-Message-State: AOAM532pRxl0qHv/tAWasqyBw6MqvAfW3UBWbpjmS9gMBWrRg9Me7jLz B5KhpSPLbR54SdxOC3FEIvh7gAlqZpq2ah5nN0ZglSRBZCo= X-Received: by 2002:a92:d2cf:: with SMTP id w15mr44414352ilg.214.1609166349557; Mon, 28 Dec 2020 06:39:09 -0800 (PST) MIME-Version: 1.0 References: <20201213183759.223246-1-aford173@gmail.com> <20201213183759.223246-2-aford173@gmail.com> In-Reply-To: From: Adam Ford Date: Mon, 28 Dec 2020 08:38:58 -0600 Message-ID: Subject: Re: [PATCH 01/18] arm64: dts: renesas: beacon kit: Configure programmable clocks To: Geert Uytterhoeven 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 On Mon, Dec 28, 2020 at 6:33 AM Geert Uytterhoeven wrote: > > 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 Thanks for the pointer. I didn't know this existed. It looks like the right thing to do. With that node, it appears to enable the versaclock and USB works. I'll submit a V3 at some point with this node added to each of the kit-level files since they use slightly different power-domains. Do I need to add updates to the bindings for renesas,r8a774a1-rcar-usb2-clock-sel; r8a774b1-rcar-usb2-clock-sel; and renesas,r8a774e1-rcar-usb2-clock-sel; or I can I just use the generic reference to renesas,rcar-gen3-usb2-clock-sel? adam > > 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