Received: by 2002:ab2:b82:0:b0:1f3:401:3cfb with SMTP id 2csp355788lqh; Thu, 28 Mar 2024 04:26:07 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXss5b1Zvok4fJd578hhRq4yoDidMejfJYorHmMIOwX339G7p+KMcVRAt1vQmRF0qiUyHBDXWrfsnWwAZnrLx5qVAY7RcMZVBQwUHFrHQ== X-Google-Smtp-Source: AGHT+IFqYtNb0Atgj5Y5LtwepuS5J0YshMwPzaYoaWSxK4lRuJMfJEiGlue5Fr96me2EgKJdy1yV X-Received: by 2002:a17:902:ecd2:b0:1e0:bc5e:5ee1 with SMTP id a18-20020a170902ecd200b001e0bc5e5ee1mr2464372plh.47.1711625167577; Thu, 28 Mar 2024 04:26:07 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711625167; cv=pass; d=google.com; s=arc-20160816; b=FgaTYo0B7ozLy+6Whg4UNYh+rR4RuHFMiLtNAmZ0N2tHuvgsJMQU+nrjCLNaUeTqgi ivP0tVUd9W05vXYmoWWMp88P4G0G/5+Go/YeMqZug6nLUAwKGsHbAEnzL83eWRKeJDH4 xESdtLcp7wskzrIYPJlwheB/xpfrtNyVG64M6Ii+9zxRIuUGTAp9tYwxAdROn1Uqd4Ro yhyqnLtFPdh4XDPDO+tb0ONkh9qVxhqURL68qRV9vOG50J1ouE+nwNvHnCWpEFYbcEpO UkW6rk0zSqLo3+IYNAaLkYOn/tbCX9UmPhf46zF+d5spMnUr5gqCF9Nk8gL5hFR19NYv Le9w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:content-transfer-encoding:references:in-reply-to:date:cc :to:from:subject:message-id:dkim-signature; bh=WIGa0icyLnmu/oBvATbqagwvaa7vtUvlqfZhWt9ytEY=; fh=cV6xYF74LLKfXrV3cVXL61WaVzhuMJ9iNunRkYx42WY=; b=i1g+qxCZ0n+HjBunc/buHanaoR7+z6oJ5hiGtpPOVSprHnlnxls/nkSapujLO2fzTL W9yBucUVmhleebbbWsi7u2vug/qq47fhw+EhE83SoaBbzb2aRVMv+ztpvFNsEpVjsLi/ Dy8YnzU/rGvJPrPTeJpAXTKW2CPFdu9cJgzzRNDe22jHfL5RhkgYmX+T2SmV9NhZbKs5 5Yl7+TAn1+4Nxxwb13ot1Fr4G86NrK2q78jPoXKuBezP5BeoNyT4o33s9SYqrJ6DiQVT RBy6KI9To28ReOowfeqvugi6ohYGcAuAhS5c8WwAPJ+oWOcuDN/dV3AUahDBFgOFaxAU qafQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VMVJqDhv; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-122829-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-122829-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id c4-20020a170902b68400b001e206374109si1195211pls.639.2024.03.28.04.26.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Mar 2024 04:26:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-122829-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VMVJqDhv; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-122829-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-122829-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 2E667294853 for ; Thu, 28 Mar 2024 11:26:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1A6927E582; Thu, 28 Mar 2024 11:25:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="VMVJqDhv" Received: from mail-lj1-f178.google.com (mail-lj1-f178.google.com [209.85.208.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8EA317CF2B for ; Thu, 28 Mar 2024 11:25:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.178 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711625158; cv=none; b=L656aObDkvO+kY88WZBLIgFCQnDPdSbGqFoU34ggB0UJrUM+i0dEM4GIjllmYyEbRkF3lhowhk5MFutAP+BMelw8f1sdE/rZFoshWNXDZvvZ2J+W2Aj04UUH/86rZg85LbEHqpDBNI4WMN3aJQ4Vuk7Im0MOfYOauIG9c+MDRDo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711625158; c=relaxed/simple; bh=WIGa0icyLnmu/oBvATbqagwvaa7vtUvlqfZhWt9ytEY=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=iYUyttB9N1l3h4niLZz9V5HvHNKzih8ooqyjzWtS9HoXA58gP/E4N+3DyrL8MnknIMUzpvxizi5DfFDu949wp9vEIpSEHxMD7rmolqycmvTc3RtR5N4yEyil1EB3Bio5UqmUkT65XpE3K+c7pNTfQ1vCfqYEOO5WsaKmhpiGh44= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=VMVJqDhv; arc=none smtp.client-ip=209.85.208.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-lj1-f178.google.com with SMTP id 38308e7fff4ca-2d24a727f78so9564781fa.0 for ; Thu, 28 Mar 2024 04:25:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711625155; x=1712229955; darn=vger.kernel.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=WIGa0icyLnmu/oBvATbqagwvaa7vtUvlqfZhWt9ytEY=; b=VMVJqDhvhHnUFn2skoGxBtE/T+sN/kvp5HoRlLlKBSfK/akZfL3cKMf06LHNZl0yPB PhNd6RhzEvjzupCBvObvvz2u1qZGkUApHPs9BTwhyDTLHFaGT6dD64zM/Keo/3FXxcfb IvFLL1mO/eHG64qS7Msni8MdSZOXeze1WU808mnjDJKMrcNLsYIUU09ca7CnhSzC5TV6 f6yXPkdk9TFiFdIq1yS+iNhYxMetoKzxCKYkYeI2NVnxgW4jxrLhQ/Ci0kVjfSl15b0+ quYUQ9rdb0K6i6ZKESeNXU6I0UgGdo3DpFIKeYG4abxa5sOBtA+IMPiM/b02XSZHAAo6 JLkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711625155; x=1712229955; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=WIGa0icyLnmu/oBvATbqagwvaa7vtUvlqfZhWt9ytEY=; b=Ud8hyevi35BTqNuDnB48w5iDhFWHhZy3Vv/w6H0Vg2Allj8EWdpBzgpuA5/MOOdRhC MdKdmOaHr/xEgr/A71APAveO/oUjRpjsBG3P8TVVfmkH6jRgip9HBLC10/dKUV6ECHQj JrKDGa3VKq+8Dj19plOl2KOXQQnJ+mcugMX0JWZKAOpar9VE1tTZn8ZWDi/b4RbBJskR cGo/NF9ORtlEW1tDbO5fKmfL14xHLgCdVPlfGbgxbAg7jjWFGfKjZwpqVeSB92BimKkc ozrMv7RQGBTP1JkX7gy4Svn+SCF8RxOsWRv9yzoyZ5vvf8p8zm+SR5o3g4BjV7WC/dEM ipOw== X-Forwarded-Encrypted: i=1; AJvYcCUOYMAF9mSbbzpSzjiPMIczxKkNPms3so5pv8vv446dcXqG537I3uXhxZhsEovwPOsO9eO86VX5/+I8v14JDlQdOgZekK/HwHNC+O6O X-Gm-Message-State: AOJu0Ywr3UxgotOctKRUdx8iPf5uyPhCenn1P/cM05y4CvMHubzukF7x dMH32epZy4+Ov5J7XlNw7acTfG9xLze5CO198+nXtL7jZ1VaGoY1KWfRiYje+Gw= X-Received: by 2002:a2e:95d9:0:b0:2d7:21f:90ef with SMTP id y25-20020a2e95d9000000b002d7021f90efmr1699128ljh.1.1711625154661; Thu, 28 Mar 2024 04:25:54 -0700 (PDT) Received: from draszik.lan ([80.111.64.44]) by smtp.gmail.com with ESMTPSA id fb7-20020a05600c520700b00414969894a1sm3877017wmb.13.2024.03.28.04.25.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Mar 2024 04:25:54 -0700 (PDT) Message-ID: <3b9d28405f01c7bc23075492dbb501ebde0edbfa.camel@linaro.org> Subject: Re: [PATCH v2 3/3] clk: samsung: gs101: propagate PERIC0 USI SPI clock rate From: =?ISO-8859-1?Q?Andr=E9?= Draszik To: Tudor Ambarus , peter.griffin@linaro.org, krzysztof.kozlowski@linaro.org Cc: alim.akhtar@samsung.com, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, willmcvicker@google.com, kernel-team@android.com, s.nawrocki@samsung.com, cw00.choi@samsung.com, mturquette@baylibre.com, sboyd@kernel.org, semen.protsenko@linaro.org, linux-clk@vger.kernel.org, jaewon02.kim@samsung.com Date: Thu, 28 Mar 2024 11:25:53 +0000 In-Reply-To: <20240326172813.801470-4-tudor.ambarus@linaro.org> References: <20240326172813.801470-1-tudor.ambarus@linaro.org> <20240326172813.801470-4-tudor.ambarus@linaro.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.50.2-1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 On Tue, 2024-03-26 at 17:28 +0000, Tudor Ambarus wrote: > When SPI transfer is being prepared, the spi-s3c64xx driver will call > clk_set_rate() to change the rate of SPI source clock (IPCLK). But IPCLK > is a gate (leaf) clock, so it must propagate the rate change up the > clock tree, so that corresponding MUX/DIV clocks can actually change > their values. Add CLK_SET_RATE_PARENT flag to corresponding clocks for > all USI instances in GS101 PERIC0: USI{1-8, 14}. This change involves the > following clocks: >=20 > PERIC0 USI*: >=20 > =C2=A0=C2=A0=C2=A0 Clock=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Div range=C2=A0=C2=A0= =C2=A0 MUX Selection > =C2=A0=C2=A0=C2=A0 ------------------------------------------------------= ------------- > =C2=A0=C2=A0=C2=A0 gout_peric0_peric0_top0_ipclk_*=C2=A0=C2=A0=C2=A0 -=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 - > =C2=A0=C2=A0=C2=A0 dout_peric0_usi*_usi=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /1..16=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 - > =C2=A0=C2=A0=C2=A0 mout_peric0_usi*_usi_user=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 {24.5 MHz, 400 MHz} >=20 > With input clock of 400 MHz this scheme provides the following IPCLK > rate range, for each USI block: >=20 > =C2=A0=C2=A0=C2=A0 PERIC0 USI*:=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 1.5 M= Hz ... 400 MHz >=20 > Accounting for internal /4 divider in SPI blocks, and because the max > SPI frequency is limited at 50 MHz, it gives us next SPI SCK rates: >=20 > =C2=A0=C2=A0=C2=A0 PERIC0 USI_SPI*:=C2=A0=C2=A0 384 KHz ... 49.9 MHz >=20 > Which shall be fine for the applications of the SPI bus. >=20 > Note that with this we allow the reparenting of the MUX_USIx clocks to > OSCCLK. Each instance of the USI IP has its own MUX_USI clock, thus the > reparenting of a MUX_USI clock corresponds to a single instance of the > USI IP. The datasheet mentions OSCCLK just in the low-power mode > context, but the downstream driver reparents too the MUX_USI clocks to > OSCCLK. Follow the downstream driver and do the same. >=20 > Fixes: 893f133a040b ("clk: samsung: gs101: add support for cmu_peric0") > Signed-off-by: Tudor Ambarus Acked-by: Andr=C3=A9 Draszik