Received: by 2002:ab2:7a09:0:b0:1f8:46dc:890e with SMTP id k9csp207747lqo; Wed, 15 May 2024 11:53:32 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWBVLVecPRhqNSrzab7Jyyj3BfRaqQB00iRam7mrc/WUDTxy/GIh6xW6mCBQanlllZgzJQXSKxSar3fbrc7KRxHg/gLvz3TsLjn5tDrsg== X-Google-Smtp-Source: AGHT+IGYYX1PFJtgap+VwFxe3HUObZHNYYtcfmazdIFFDpHIstursqCWwTEnRym4rJ0lJEf59dSA X-Received: by 2002:a17:902:d2d0:b0:1e4:59a2:d7c1 with SMTP id d9443c01a7336-1eefa58c6ebmr299084435ad.33.1715799212391; Wed, 15 May 2024 11:53:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715799212; cv=pass; d=google.com; s=arc-20160816; b=oEjA8R2UQ76xFcnSWlLID4HY8pxvhqO0Zca6MlCoaA2CCytiAGmPaxx30PdBNm23UI 91cARLgHxU0vKUvcByx5CpR0K85AF+Hz+DoKpIsTmnKAaJ78qAnoelyRH1YqYXa+UQcC A4L8fRdx9zv6J7RfTIoX2iR3hmJwdeuscsvfV+W3AePp/hAXjHgAz16yF41Ef0gMTuLk waqzi6YgRkUaHm6u1dbJPhRAFADQO5S1JliJIqodE8lO+GnkYZP/gGTNh3Q5BYu1oJmi fXDdd6fTiNRxRk+JMQtEdpdl2L+ebaqR+u9MHBKTu6KvKA1QMKPK2fgP4nX2OVLmu1s0 i5Hw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature:dkim-filter; bh=6j+cd3D6A9wkF5Z/jGDf6RAc3Fv8FBkYTu7czdc0OWc=; fh=5rP0iG3CCGB7t2KZ5VNAaIzWJmpGQq0pxIoZl6NmbCQ=; b=l5phE383GUyfn1BZA9C6mHeW4G5Q+ZlxO2sBH9E6KtZFJyZGkDIQzxYCi8yArXltqD Q4KaufQIGGKEJtzjlwSVpQRrvn/7GT/hR2uy5LKhRtghL9BRFTG9A9TRfXGYDpbOZ++5 24Tb5SiPcg0y7dzcO1MFZHVwjHaWA50PPzpNO840A+rU0BYNpi2/qfERQS3pmqRDItH2 AD7dhVB2phvLMY5OIU7XZShcMSVjQLM1Ee5gEzruJevkPr54N9/jr+HAyst5MoQKZ01d By6wz9ZJyMrH/Y6V8oasp34ho778qXyn+OZ/tyd+XXnfOzKVEFAKRIHObuVPshByDXgt m/Sg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=W+8Qot0p; arc=pass (i=1 spf=pass spfdomain=salutedevices.com dkim=pass dkdomain=salutedevices.com dmarc=pass fromdomain=salutedevices.com); spf=pass (google.com: domain of linux-kernel+bounces-180284-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-180284-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=salutedevices.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id d9443c01a7336-1ef0bf325e7si146166705ad.237.2024.05.15.11.53.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 May 2024 11:53:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-180284-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=W+8Qot0p; arc=pass (i=1 spf=pass spfdomain=salutedevices.com dkim=pass dkdomain=salutedevices.com dmarc=pass fromdomain=salutedevices.com); spf=pass (google.com: domain of linux-kernel+bounces-180284-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-180284-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=salutedevices.com 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 03DF3B236F6 for ; Wed, 15 May 2024 18:52:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2D9C315B104; Wed, 15 May 2024 18:51:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=salutedevices.com header.i=@salutedevices.com header.b="W+8Qot0p" Received: from mx1.sberdevices.ru (mx1.sberdevices.ru [37.18.73.165]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A215C158DD1; Wed, 15 May 2024 18:51:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=37.18.73.165 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715799085; cv=none; b=RPb+GUULnobtoQ3bYqJHWnmIRRGNKMQGGoA+5IMktTvpLATwSGZjAYTnarpKzE/EPFMeef0JQQDxaRVBuW5VppbYh3Z9KTQ57j4gCFU3UROgPNAW+b+e1QUJz0wMu/dWSxNvMxE9dVY7ba7tcAaINOHpt5m9GPy91ghBenDgEtY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715799085; c=relaxed/simple; bh=W0Cn6/0lFacD4kmjZLOfrKH/Raaz4LuoNTVSYZ+H9vM=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=P4dMgXp43GiSV4uFZHbV5Dk1kD/cyxxuZsQmaonWdozuUoalt0iZwpzwqKsmiEq0/uPz10RiQG+KcWmD4JN/bZWR/T02uR2XuLW1F7mu+NDbqfEPjzkLQedUOV7a7bsnnTT6A33OrqCeeQRiOzBS4Cyw2iBGYCr1v4YQvepKSA8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=salutedevices.com; spf=pass smtp.mailfrom=salutedevices.com; dkim=pass (2048-bit key) header.d=salutedevices.com header.i=@salutedevices.com header.b=W+8Qot0p; arc=none smtp.client-ip=37.18.73.165 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=salutedevices.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=salutedevices.com Received: from p-infra-ksmg-sc-msk01 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id EC313100031; Wed, 15 May 2024 21:51:15 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru EC313100031 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1715799075; bh=6j+cd3D6A9wkF5Z/jGDf6RAc3Fv8FBkYTu7czdc0OWc=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=W+8Qot0pe6zDk1PjtCo5+GrMLoUE3bgKR0O6aJhF+VwNzwc4T64YRA+DajAtzEvCR BNZ9oumNb4fcmd6wlTnZEPKdMCb/RCUFXO7quhOEB7dfXPs7WOnC4sBjtkxo/Se9lK Hxuy6YS0AZ66ikzNQpsubo74ToOSR0Ez6zZu1wLXtAZgsHvL9tKxPEXFm36TqLCMZr BO7TlgaVCjawHJSwmSg+tWpxe0JbRSW4ToM1SdPfN9kczRasGuY5RRl3neMETxN+wv BomhwX9NIxfDaev6sU5ECFvkPehDbuCa48aBNBcQe8Itg0Ek/RBM6c0fpm7lByvPEj s4W8oFgLkjjJg== Received: from smtp.sberdevices.ru (p-i-exch-sc-m02.sberdevices.ru [172.16.192.103]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.sberdevices.ru (Postfix) with ESMTPS; Wed, 15 May 2024 21:51:15 +0300 (MSK) Received: from CAB-WSD-L081021.sberdevices.ru (100.64.160.123) by p-i-exch-sc-m02.sberdevices.ru (172.16.192.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Wed, 15 May 2024 21:51:15 +0300 From: Dmitry Rokosov To: , , , , , , , CC: , , , , , , , , Dmitry Rokosov Subject: [PATCH v3 5/7] clk: meson: a1: peripherals: support 'sys_pll_div16' clock as GEN input Date: Wed, 15 May 2024 21:47:28 +0300 Message-ID: <20240515185103.20256-6-ddrokosov@salutedevices.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240515185103.20256-1-ddrokosov@salutedevices.com> References: <20240515185103.20256-1-ddrokosov@salutedevices.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: p-i-exch-sc-m02.sberdevices.ru (172.16.192.103) To p-i-exch-sc-m02.sberdevices.ru (172.16.192.103) X-KSMG-Rule-ID: 10 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Lua-Profiles: 185260 [May 15 2024] X-KSMG-AntiSpam-Version: 6.1.0.4 X-KSMG-AntiSpam-Envelope-From: ddrokosov@salutedevices.com X-KSMG-AntiSpam-Rate: 0 X-KSMG-AntiSpam-Status: not_detected X-KSMG-AntiSpam-Method: none X-KSMG-AntiSpam-Auth: dkim=none X-KSMG-AntiSpam-Info: LuaCore: 20 0.3.20 743589a8af6ec90b529f2124c2bbfc3ce1d2f20f, {Tracking_from_domain_doesnt_match_to}, 127.0.0.199:7.1.2;smtp.sberdevices.ru:7.1.1,5.0.1;100.64.160.123:7.1.2;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;salutedevices.com:7.1.1, FromAlignment: s, ApMailHostAddress: 100.64.160.123 X-MS-Exchange-Organization-SCL: -1 X-KSMG-AntiSpam-Interceptor-Info: scan successful X-KSMG-AntiPhishing: Clean X-KSMG-LinksScanning: Clean X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.0.1.6960, bases: 2024/05/15 13:12:00 #25231738 X-KSMG-AntiVirus-Status: Clean, skipped The clock 'sys_pll_div16' is one of the parents of the GEN clock. It is generated inside the A1 Peripherals clock controller from 'sys_pll' PLL clock source with a fixed factor. Signed-off-by: Dmitry Rokosov --- drivers/clk/meson/a1-peripherals.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/drivers/clk/meson/a1-peripherals.c b/drivers/clk/meson/a1-peripherals.c index 621af1e6e4b2..56e44299982c 100644 --- a/drivers/clk/meson/a1-peripherals.c +++ b/drivers/clk/meson/a1-peripherals.c @@ -746,14 +746,27 @@ static struct clk_regmap fclk_div2_divn = { }, }; +static struct clk_fixed_factor sys_pll_div16 = { + .mult = 1, + .div = 16, + .hw.init = &(struct clk_init_data){ + .name = "sys_pll_div16", + .ops = &clk_fixed_factor_ops, + .parent_data = &(const struct clk_parent_data) { + .fw_name = "sys_pll", + }, + .num_parents = 1, + }, +}; + /* - * the index 2 is sys_pll_div16, it will be implemented in the CPU clock driver, * the index 4 is the clock measurement source, it's not supported yet */ -static u32 gen_table[] = { 0, 1, 3, 5, 6, 7, 8 }; +static u32 gen_table[] = { 0, 1, 2, 3, 5, 6, 7, 8 }; static const struct clk_parent_data gen_parent_data[] = { { .fw_name = "xtal", }, { .hw = &rtc.hw }, + { .hw = &sys_pll_div16.hw, }, { .fw_name = "hifi_pll", }, { .fw_name = "fclk_div2", }, { .fw_name = "fclk_div3", }, @@ -2024,6 +2037,7 @@ static struct clk_hw *a1_periphs_hw_clks[] = { [CLKID_DMC_SEL] = &dmc_sel.hw, [CLKID_DMC_DIV] = &dmc_div.hw, [CLKID_DMC_SEL2] = &dmc_sel2.hw, + [CLKID_SYS_PLL_DIV16] = &sys_pll_div16.hw, }; /* Convenience table to populate regmap in .probe */ -- 2.43.0