Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp4617264pxb; Sun, 27 Mar 2022 23:29:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJylF1gR6ETq6A9wmlT4+DwmLnM9O4hd91XJUa5oyjcEQzzZ17a0bThPmkXAcjDRmtc9Wmjc X-Received: by 2002:a17:902:f64e:b0:14d:20db:8478 with SMTP id m14-20020a170902f64e00b0014d20db8478mr25277285plg.158.1648448964567; Sun, 27 Mar 2022 23:29:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648448964; cv=none; d=google.com; s=arc-20160816; b=NerjoGWE/BkYaNhfvr/9qKTL581GN0eJu2kl8oNuGP6cruR8CBDLMh3qycJpvKFrKr c90yzBpI8aea6WdopUJ2416mPFvFwOI1KjJfSlCEUwYPzIyaHRuvOos9QSVR2hfA9xXQ IrpJtd3R7XgedgFVkBKkQ9TVJe0zUzamwtS08WNxSE9XqgaF6UeCvJDiYbHx5i3xCHA8 ol+pTOyisyAlfCLIWm8zXblQOBbV0x9gwyw21h8V6A12YpQfue4G9RPBSnCAWC5ILOge HAz/M2d7NsEahZiDn4yqZJ69TFu8r7t1lZ/7TwnJzMK8pSsF5ZUq5iyiXVHVRsBtGKf9 0u/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=19uBF9iCIoMNrxoWIz9dMSdfhYfSKOAUfWryPoAUr/c=; b=EDSS3k/tBaF3sAgjx/VcHNH8MsLTlnPk+gcZ7ohvoaVfg7HQ12IMwqPCGExlMAJ5Zh LFnniOUWPP4f0UZqVx/Bj1zi+ylI6L0K9feWJGUsrE72R/FBeEU7+LPVwJB2kGD4LDe/ dGcoXbnpqnk3q22XnsclVvumWApOsF73ZHancoLkvIck0uBBAv+UVWIBjl2sp/DJ32zZ 35cEYQlC0+g6D8EGSOnaO5Z1nJAcwdbhpN4rE+k09yWAcWRsWLaYVElBavka5z4iAoEF ywSDjOnKzeKu1957rLcZJe5V++q5xq/dMfxF72Jjtnx7yNyHdIGU0xchgnNkviAIxmNk swUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Gje6NJsy; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c17-20020a63d151000000b003816043ef42si11401782pgj.311.2022.03.27.23.29.11; Sun, 27 Mar 2022 23:29:24 -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=@gmail.com header.s=20210112 header.b=Gje6NJsy; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233446AbiC0Sd4 (ORCPT + 99 others); Sun, 27 Mar 2022 14:33:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50476 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229529AbiC0Sdz (ORCPT ); Sun, 27 Mar 2022 14:33:55 -0400 Received: from mail-qk1-x736.google.com (mail-qk1-x736.google.com [IPv6:2607:f8b0:4864:20::736]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 993771A811; Sun, 27 Mar 2022 11:32:16 -0700 (PDT) Received: by mail-qk1-x736.google.com with SMTP id 1so9866434qke.1; Sun, 27 Mar 2022 11:32:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=19uBF9iCIoMNrxoWIz9dMSdfhYfSKOAUfWryPoAUr/c=; b=Gje6NJsyJp7AHQqT8ZqvE+6dIuz3pv15I4EH5k6OsoU+u8gfU8rTssKRtwx1aJXBj1 0aSvPogUKwd3anE2Qwp0SJQJXD1Q/DrTfufYwhPAU7wNL8+StG7Kr4/ZO46hZV8HmoIi zbhGm1yN/SOLjvVRFhHKef1ugLlgQNTDs7JhrNE8ynd8yH1Xdppwa/jQnpjVkJIALGKW ENpLg3SwSDyMW8otYwnsPwZT7ZlZToUIZfp7MZUHK1vprze3Mk1sY4i1Ll1lwuDSUdCv ZwM8i8rAEMAHbje9tk19AvBCzRjrOCwGu0/YbcNlxUprgloq6dF52KPdxWBbvtCeG3MR i28w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=19uBF9iCIoMNrxoWIz9dMSdfhYfSKOAUfWryPoAUr/c=; b=33RO0RSGYM7fDkWpxPc0cIwIsPLdnQFCBnn4s/ByqDbAOsYQZJcsJEo7/dBBRrvvaT pPtp/eOtthFEyK2ZvXAXZrww5ezH7cY62uA86FiA9kBFTMzXvzSMWCWsM2X6fgBDJPxF 30A8xpML+xDN81ClMwtEMG4BBNMQM4VA5d5d0mtML8y9un3f0nrRqnNv4VO7KGznrqsR D/qsZcTtM52WN8Ca1DaX3iZuAbE0HJn14WIcxtikURuqIRpU2XpvCxuljJun+sy4KAG0 jAt/iZVZMzoNJKZV0ZiAgQauiGIhzahvg9dnGb+U1f1IqNvU7KH+0+reB1jRhBr7ZF8w QocQ== X-Gm-Message-State: AOAM530/Fh+mkQqbTzHbM/LQwk2P+lnh5jbuUfB+xsyK/g9/VG5apDgd TgCxsdZD0IqgXhegJ3K2l3U= X-Received: by 2002:a37:9dca:0:b0:67b:8dfb:6835 with SMTP id g193-20020a379dca000000b0067b8dfb6835mr12859531qke.638.1648405935727; Sun, 27 Mar 2022 11:32:15 -0700 (PDT) Received: from localhost (pppoe-209-91-167-254.vianet.ca. [209.91.167.254]) by smtp.gmail.com with ESMTPSA id q26-20020ae9e41a000000b0067d1a20872fsm6564613qkc.94.2022.03.27.11.32.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 27 Mar 2022 11:32:15 -0700 (PDT) Date: Sun, 27 Mar 2022 14:32:13 -0400 From: Trevor Woerner To: Vladimir Zapolskiy Cc: Robin Murphy , Arnd Bergmann , Kuldeep Singh , Olof Johansson , SoC Team , Rob Herring , DTML , Linux ARM , Linux Kernel Mailing List Subject: Re: [PATCH v2 3/3] ARM: dts: lpc32xx: Update spi clock properties Message-ID: <20220327183213.GA36326@localhost> References: <20220311093800.18778-4-singh.kuldeep87k@gmail.com> <4aae560d-d266-d0d0-136f-32891b15bc01@mleia.com> <4f39f086-1932-1729-8761-d5c533356812@mleia.com> <4a7e3d0e-f804-74a5-ef5b-206404eb9b61@mleia.com> <024f0d22-47d8-2d14-bed4-9f538a1537b3@mleia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <024f0d22-47d8-2d14-bed4-9f538a1537b3@mleia.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,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 Vladimir, On Sun 2022-03-27 @ 07:27:00 PM, Vladimir Zapolskiy wrote: > Hi Trevor, > > On 3/27/22 5:57 AM, Trevor Woerner wrote: > > On the lpc32xx both the SPI and SSP peripherals are APB devices (low-speed) > > > > lpc32xx-apb-peripherals.png > > The APB devices on this SoC are driven by the PERIPH_CLK which can be > > derived from either the HCLK or the SYSCLK. > > thank you for the data, I'd like to reference to Table 14, which says that > both bus clock source and function clock source for SSP0 and SSP1 are a > non-selectable HCLK. I'm unsure if for instance PERIPH_CLK can be set as > a function clock source for SSPx. Interesting. I see that I had assumed that all APB peripherals would be driven by the PERIPH_CLK since the diagram shows that clock as going to all APB peripherals. In the SSP chapter, for example, there is a clock prescale register, which says: This register controls the factor by which the prescaler divides the AHB clock HCLK to yield the prescaler clock that is, in turn, divided by the SCR factor in SSPnCR0, to determine the bit clock. So that confirms that the clock driving the SSP (an APB peripheral) is the AHB's HCLK! Section 21.7 of the SPI chapter also clearly shows the SPI clock as being derived from the HCLK as well. Thanks for the clarification :-) > > lpc32xx-clock.png > > The default on reset is for PERIPH_CLK to be derived from the SYSCLK but > > both U-Boot and Linux run in "normal" mode, which is to say that > > PERIPH_CLK, HCLK, ARM_CLK, and DDRAM_CLK are derived from the HCLK PLL.> > > There is no separate SSP clock, the SSP is driven by one clock: the > > PERIPH_CLK (or "apb_pclk"). > > Right, there is no separate SSP clock in sense of a bus clock, it is > correct to get HCLK clock (or equally its child SSP clock) rate as a bus > clock rate, and the reason for introduction of SSP0/SSP1 clocks is that > these clocks are gated. > > If I'm correct above, what does it mean in connection to LPC32xx device > tree bindings? The first or single clock source shall remain to be SSPx > clock, either the former is "sspclk" or "apb_pclk". Doesn't this mean the apb_pclk should not be specified as the SSP/SPI clock? If sspclk is a synonym for HCLK, then sspclk and apb_pclk are completely different clocks. On my device HCLK is 260MHz and PERIPH_CLK is 13MHz.