From patchwork Mon Oct 24 04:40:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Siarhei Volkau X-Patchwork-Id: 8156 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp251595wru; Sun, 23 Oct 2022 21:44:00 -0700 (PDT) X-Google-Smtp-Source: AMsMyM41yEoD7wURtbOGZv6tNSLsGRt1dvnJv8ObLd9I3btS/RzgL0fcalAZJkpMqOPKkFqqEtaI X-Received: by 2002:a17:902:f707:b0:184:e44f:88cc with SMTP id h7-20020a170902f70700b00184e44f88ccmr31610293plo.42.1666586640648; Sun, 23 Oct 2022 21:44:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666586640; cv=none; d=google.com; s=arc-20160816; b=BccSnkDrh/weIa1T4JO289AwyPAmTwQJK1J3XA344sRmXIaThDPJgACjZbp7OEhuqy 87BqZFMmMUysOS+nIz479Cf/7WPHjK96z1k6x6de/DAphK2MdzG8R97geHq23ECcduKs /Z7ZXHAykIhOmCeS4vV/URBlDA+LKbo0o4hEJm3BU4+wWHYFz/5gtNaXDE1C2W9TPfaX 0Ot3NBxT3S/wVvJt7Y4HenYXK2FvyQub8wVWfC483xRAofXZgy2P6Hn9YGBEXdfJKKK0 d34xf/wiwmnuO5lF9RcdHEzQbbQb2dE9oU3t2ZwUof6S/OLfM7gayM40eSnKS4FbNq/i TxcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:from :dkim-signature; bh=KDghWiI+VfS+QbKsUYVkwYkySZv+irXHu5fI56T3Y+4=; b=bC1/vcRVLJjmSW4/L+1mibKTEpyeAw1RLHiaEV/0KItTcYk3TeyfPxam/zgVlwbDwO zq2IS3XXq4G4nP5+yWewQEXcTWfaw8pgWf0vAgXJoUsD5W3ZsapNZ61ywAk5EJl3utTA bVzz/kat8MqvjcdtUDuFRXru4b1EIg5THItaFHrSAsg97wK7VQsMOyhrJdlhMwy1e2dw 8jICvbhvlarKrV4pzs8IT+SBcOkHwwRVrzikzc1n0xb2pPZI8ESy6lKB/aLG1Bk+7pKi AcmjxEZKOQyWbg9eDNsakltRv4Ccxpxl9XUkTswenG3CkX0YmVYruASyn8wImbxymvtj gnnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20210112 header.b=jlyQHSJV; 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=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n12-20020a63f80c000000b0046ef5b35735si4687545pgh.654.2022.10.23.21.43.48; Sun, 23 Oct 2022 21:44:00 -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=fail header.i=@gmail.com header.s=20210112 header.b=jlyQHSJV; 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=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229556AbiJXElq (ORCPT + 99 others); Mon, 24 Oct 2022 00:41:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58228 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229967AbiJXElh (ORCPT ); Mon, 24 Oct 2022 00:41:37 -0400 Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C9DD8796B7; Sun, 23 Oct 2022 21:41:36 -0700 (PDT) Received: by mail-wm1-x333.google.com with SMTP id bh7-20020a05600c3d0700b003c6fb3b2052so5879155wmb.2; Sun, 23 Oct 2022 21:41:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=KDghWiI+VfS+QbKsUYVkwYkySZv+irXHu5fI56T3Y+4=; b=jlyQHSJVM1ckmfkQqatiCEvt56zwVDqmhlesOcj2hUCDfSNEATcIMva4XyKHKmRVCM E8+8vvmQzrlbtezGSedgSuPUNA1sp9CXCCYkZU4IX+y+TJyYmW2pYEp2PEL6Ym1QaaVT Bo0DRy7zzqCxbRUqyC/7zkRkQNM8fLk/6EptXnoc1Drw8kDCwHbqHaIbA8Jz5I9MZkzF lsUgJ/3ru2Op4WJ1/GneBMKx122g7kX0HvoKNd2X6PYXfT2QB20QY4CA2JpgjvZGlpe7 nFHcw9QV50nm1N4L7R6mbGrwSYNo8YfFcvDVAI8iQHv2qViayLAQQoeYraSKv+N3HkTP K5vw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KDghWiI+VfS+QbKsUYVkwYkySZv+irXHu5fI56T3Y+4=; b=Ww4gx8V5UJBii1D7NA9Gx19/4dsEVDtAMZuGQOny/LvUEPFbzfmAbzgdaxRItsBzHD zX7HPZuR/zJweSIWXQOo+J4wW2bNJohhZkuhEsyWba80OKFuKZH1g8/jWAkIigGoGdB0 qjrLSKhnxMy0tuQl3ztM1ib976T0p53HETTEcJz/FPG5j+AXd5mwlLCwF2LCzz3edtvV DIiIV2eRQKcboQJ1/hh7IAhHF4AyB5/ukdnyFeQRWeSesJTfgw98xy8aO2Oisxi81etS tfGMn5PyMR4BFlUN286le9l4Z46dZ814joQeAwElJnbXeQGP5UeRphhU/j/2nxd+Fchq mm9Q== X-Gm-Message-State: ACrzQf0XI4f38hErPBHk2O7arhTCUpHLbWOPAg6oLvP43qJ7NSu1CBX1 im32z0BXOqAULMZp2Lg2qUWxSfw/dV1Y7w== X-Received: by 2002:a05:600c:1549:b0:3ce:794f:d801 with SMTP id f9-20020a05600c154900b003ce794fd801mr2623380wmg.63.1666586495423; Sun, 23 Oct 2022 21:41:35 -0700 (PDT) Received: from hp-power-15.localdomain (mm-197-18-212-37.vitebsk.dynamic.pppoe.byfly.by. [37.212.18.197]) by smtp.gmail.com with ESMTPSA id l39-20020a05600c1d2700b003c6deb5c1edsm9856925wms.45.2022.10.23.21.41.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Oct 2022 21:41:35 -0700 (PDT) From: Siarhei Volkau Cc: Siarhei Volkau , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Paul Cercueil , linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org Subject: [PATCH v5 1/3] dt-bindings: ingenic: Add support for the JZ4755 CGU Date: Mon, 24 Oct 2022 07:40:54 +0300 Message-Id: <20221024044057.4151633-2-lis8215@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20221024044057.4151633-1-lis8215@gmail.com> References: <20221024044057.4151633-1-lis8215@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747542753540396418?= X-GMAIL-MSGID: =?utf-8?q?1747542753540396418?= Add documentation for the clock generation unit (CGU) of the JZ4755 SoC. Signed-off-by: Siarhei Volkau Acked-by: Krzysztof Kozlowski --- Documentation/devicetree/bindings/clock/ingenic,cgu.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/clock/ingenic,cgu.yaml b/Documentation/devicetree/bindings/clock/ingenic,cgu.yaml index aa1df03ef..df256ebcd 100644 --- a/Documentation/devicetree/bindings/clock/ingenic,cgu.yaml +++ b/Documentation/devicetree/bindings/clock/ingenic,cgu.yaml @@ -22,6 +22,7 @@ select: enum: - ingenic,jz4740-cgu - ingenic,jz4725b-cgu + - ingenic,jz4755-cgu - ingenic,jz4760-cgu - ingenic,jz4760b-cgu - ingenic,jz4770-cgu @@ -51,6 +52,7 @@ properties: - enum: - ingenic,jz4740-cgu - ingenic,jz4725b-cgu + - ingenic,jz4755-cgu - ingenic,jz4760-cgu - ingenic,jz4760b-cgu - ingenic,jz4770-cgu From patchwork Mon Oct 24 04:40:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Siarhei Volkau X-Patchwork-Id: 8157 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp251796wru; Sun, 23 Oct 2022 21:44:38 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6tSEp9PDY3J6qMPJCZjPb9JyOcV2QVSFH38zvh9GNhB38k4STpZCekMexrF21KAxVoIgHA X-Received: by 2002:a17:902:8205:b0:185:33e:2a0e with SMTP id x5-20020a170902820500b00185033e2a0emr31067974pln.92.1666586678275; Sun, 23 Oct 2022 21:44:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666586678; cv=none; d=google.com; s=arc-20160816; b=gZtst5HFIspHxPWSOI4mm3mx+27A77f6gy/sUNY46psF3XYKIJHBMgfU0xuniAcdvX /borRHGTTHk1KJb2CH7k1Ezi+rpfDcqc4HLNJpoJQP64yJ3JxcrqioL862pd8d/yTESh xwNfjJBaItqT9+vPih8Y0dg/NSmF/1X+wzlmmimMsH8IUGBIDmAoQ5ClwpcIVRGvdc6D No/BONk9SbDf7j0CDw13vkPRrtajwe+S5WN6FL/qrfFQw/ksmQA6ct/4+SdlldfTHVHd Imi6em5I+1jLjMdIiia/HWSrdNZOjDrCUycwPZiBMpzxtmH6IOc+8KroV7vm9qzRMtn9 Uugg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:from :dkim-signature; bh=wICd/6PuTpid08ZKJYuwFfQs4b4ZSUfrEfLUDuMq7r4=; b=fAmZM6wSGT7efO8d4pMU+jHExubeUVCcZPDgIXUdTVAFqzbhrVnjIljB/qrvfANc+3 +M6nZHCcxm2l6oT5bUhOTHQmRqWLfLj/iI+LuyS7VBMKjkUvscUlJKBpHi+IO1IXhy/Y pTTeuGLZpl40mJkOiRu2UE2QIho4kMh8nHRo59fUcT1Y8XfYYT0HvoVIeeN7Y7bB+pOT 7vwtS25cW7q0ceS1NV/aKbaKGtndRwNjo0ffrsk5RqQTc1rehliwCgchHwIZrMoH1+zk fHCRzrXW0RjBJGE85lsYrlrL/IF9f45T8XA99AtnpJEHB1+n8v9RRke1xESEmN2aUTfz Qnzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20210112 header.b=jjZRu61Z; 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=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f32-20020a635560000000b0045b00922ba5si35921680pgm.871.2022.10.23.21.44.25; Sun, 23 Oct 2022 21:44:38 -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=fail header.i=@gmail.com header.s=20210112 header.b=jjZRu61Z; 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=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230074AbiJXEl5 (ORCPT + 99 others); Mon, 24 Oct 2022 00:41:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54786 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229993AbiJXElj (ORCPT ); Mon, 24 Oct 2022 00:41:39 -0400 Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C5D564F644; Sun, 23 Oct 2022 21:41:38 -0700 (PDT) Received: by mail-wm1-x336.google.com with SMTP id bh7-20020a05600c3d0700b003c6fb3b2052so5879177wmb.2; Sun, 23 Oct 2022 21:41:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=wICd/6PuTpid08ZKJYuwFfQs4b4ZSUfrEfLUDuMq7r4=; b=jjZRu61Zz9je/FuNlTUBvyCzyajBofhir7iaRQiirc5cqEPZbgGWSYX3FpKJRUMwpy M2eOBXg9j85DhSHRknLW+t+XRJxIbdtHnOhIE9cWIFJXDU+gwSFdiyBMH2gnJ820rYT3 K3Kt+29QslICltY4OJTahLnylxchXxZ10Suy9ayQ/OAqToAvPPELIQP7uf6mf0kO+S89 bItqF14g5jNghSMpwkwF2jKYgGsvmDdBZX5BaCNUqA3L1eAbVEt1mpwsJ+Zd1j/Po94u o79us3crzVgapMzUXdh5EJ11ihbOucW0qJrhbRlmPs2PrUUpOQH5kgshQe1UdKLfpL/l lXcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wICd/6PuTpid08ZKJYuwFfQs4b4ZSUfrEfLUDuMq7r4=; b=kmn+6/Uk9d57V+80MZEVlfOQRzPVQqW9/5snbvzkwI0MinDDDRt2w0v80ANVq09hCW nnRHtn5rgqZBQESMHYkTVeCvjDHHNflUX46qKAeU0DwPhdPGvKa8XU1q6t7EfR4XA7Hk TpI45yesrEa3gu8m1JkfLpccQ++yTKooPrQI7ICJczhPomyo6HcEA5S2BmMEfXG26KX+ Kbyn+4sLGhud7cjKH2c3Hb49OndhT7a7+cNMr/gAQDjI6n+Aqe/9wI4I3hzRY/jXkfEe jiaXCaHaiLyGjnnvY18YNAa8ksUKHtoovr0LRqEw/RWC5pgaGBfshzqsgL2V/Q8eKlb4 w5cA== X-Gm-Message-State: ACrzQf1VWX8ua80erNEzrlPLQUgiPho+8IjwsJWeacXA48gY348+0V24 8AYuwjCU5QVubWmzUKcjrWI= X-Received: by 2002:a05:600c:3585:b0:3b4:a308:1581 with SMTP id p5-20020a05600c358500b003b4a3081581mr42475836wmq.77.1666586497358; Sun, 23 Oct 2022 21:41:37 -0700 (PDT) Received: from hp-power-15.localdomain (mm-197-18-212-37.vitebsk.dynamic.pppoe.byfly.by. [37.212.18.197]) by smtp.gmail.com with ESMTPSA id l39-20020a05600c1d2700b003c6deb5c1edsm9856925wms.45.2022.10.23.21.41.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Oct 2022 21:41:37 -0700 (PDT) From: Siarhei Volkau Cc: Siarhei Volkau , Krzysztof Kozlowski , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Paul Cercueil , linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org Subject: [PATCH v5 2/3] dt-bindings: clock: Add Ingenic JZ4755 CGU header Date: Mon, 24 Oct 2022 07:40:55 +0300 Message-Id: <20221024044057.4151633-3-lis8215@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20221024044057.4151633-1-lis8215@gmail.com> References: <20221024044057.4151633-1-lis8215@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747542792348086526?= X-GMAIL-MSGID: =?utf-8?q?1747542792348086526?= This will be used from the devicetree bindings to specify the clocks that should be obtained from the jz4755-cgu driver. Acked-by: Krzysztof Kozlowski Signed-off-by: Siarhei Volkau --- .../dt-bindings/clock/ingenic,jz4755-cgu.h | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 include/dt-bindings/clock/ingenic,jz4755-cgu.h diff --git a/include/dt-bindings/clock/ingenic,jz4755-cgu.h b/include/dt-bindings/clock/ingenic,jz4755-cgu.h new file mode 100644 index 000000000..10098494e --- /dev/null +++ b/include/dt-bindings/clock/ingenic,jz4755-cgu.h @@ -0,0 +1,49 @@ +/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */ +/* + * This header provides clock numbers for the ingenic,jz4755-cgu DT binding. + */ + +#ifndef __DT_BINDINGS_CLOCK_JZ4755_CGU_H__ +#define __DT_BINDINGS_CLOCK_JZ4755_CGU_H__ + +#define JZ4755_CLK_EXT 0 +#define JZ4755_CLK_OSC32K 1 +#define JZ4755_CLK_PLL 2 +#define JZ4755_CLK_PLL_HALF 3 +#define JZ4755_CLK_EXT_HALF 4 +#define JZ4755_CLK_CCLK 5 +#define JZ4755_CLK_H0CLK 6 +#define JZ4755_CLK_PCLK 7 +#define JZ4755_CLK_MCLK 8 +#define JZ4755_CLK_H1CLK 9 +#define JZ4755_CLK_UDC 10 +#define JZ4755_CLK_LCD 11 +#define JZ4755_CLK_UART0 12 +#define JZ4755_CLK_UART1 13 +#define JZ4755_CLK_UART2 14 +#define JZ4755_CLK_DMA 15 +#define JZ4755_CLK_MMC 16 +#define JZ4755_CLK_MMC0 17 +#define JZ4755_CLK_MMC1 18 +#define JZ4755_CLK_EXT512 19 +#define JZ4755_CLK_RTC 20 +#define JZ4755_CLK_UDC_PHY 21 +#define JZ4755_CLK_I2S 22 +#define JZ4755_CLK_SPI 23 +#define JZ4755_CLK_AIC 24 +#define JZ4755_CLK_ADC 25 +#define JZ4755_CLK_TCU 26 +#define JZ4755_CLK_BCH 27 +#define JZ4755_CLK_I2C 28 +#define JZ4755_CLK_TVE 29 +#define JZ4755_CLK_CIM 30 +#define JZ4755_CLK_AUX_CPU 31 +#define JZ4755_CLK_AHB1 32 +#define JZ4755_CLK_IDCT 33 +#define JZ4755_CLK_DB 34 +#define JZ4755_CLK_ME 35 +#define JZ4755_CLK_MC 36 +#define JZ4755_CLK_TSSI 37 +#define JZ4755_CLK_IPU 38 + +#endif /* __DT_BINDINGS_CLOCK_JZ4755_CGU_H__ */ From patchwork Mon Oct 24 04:40:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Siarhei Volkau X-Patchwork-Id: 8158 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp253614wru; Sun, 23 Oct 2022 21:52:13 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4R4c+fPhKfbcEyOgmev3Oy+VJ1y8UmCsXAMHZXYrqZhVMc0z4jhwjpaMWIf5CK81U/Vz2o X-Received: by 2002:a17:902:860a:b0:186:7eab:afa2 with SMTP id f10-20020a170902860a00b001867eabafa2mr14404898plo.46.1666587133224; Sun, 23 Oct 2022 21:52:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666587133; cv=none; d=google.com; s=arc-20160816; b=J5cVVvyFD8riTK9yN2mCBccE80TDCZzadB0Iht67RQsiMJ9a/RUe8C0RsX9sqtdqLA 7E4QCsskvJdCqd2Dgoe9crnQ6GlrHy18VGDto7OjKeBiP01w2phxL0AY8lcZ2CMbpowN UbC4iSnzTp16Sz8lH6HGJCrBHnEUj8F+c4D+Q3Co8GWpvm0AbyT8A4v2+W8Qo0absaCR SjlXUrSKN2CK6HjkXT5zyxrd7lf3ElGCjAgiApbdrAf+GNFedtLZ3Bxbxpw5JIgy/TJz Icf0HQjjCGK4+9ALaMPtcRkoLa1lG4xEMFsCfJDrg9ePAZ+zf/wBJqwCcImJK6HxEZqi sZzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:from :dkim-signature; bh=9or8BQZ5UocHwGTC/NbwWWjQgKltm58wOJFrxqGoBWI=; b=CbuENC7IWtO7m6pxosVa7XGvsfmkKUS3cmuPKAY8BIeN3KwPjRYBHmSx+IT8BJ8xM9 GHWHUPhGfGITo/cAKpT2n72+GhJOrhF8ozl1IblcOvcFU61R/CgegUYD8LFkTjuLu7R3 2p/+t01ZBR+gIv0x1lppgMm1TTAfVJw6CEm4hkQgSVdg84+U9ETjXzcKCZnlJqh7Gich TgTqvN7gsyUOeO5r3WI0xjpLyktY23wKIVaqT4maZo4FCegfisFMbgzv2P+BNIw6jEKy 5zbM4Rro1+euy3MemI8h0iTPJmmndZMvXnyzcQTcTtTxf4Zt9udKz9NEf3Dlbqt3E8/Y +QAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20210112 header.b=PTpgys4k; 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=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b12-20020a63d80c000000b004598a3797b1si35591122pgh.369.2022.10.23.21.51.57; Sun, 23 Oct 2022 21:52:13 -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=fail header.i=@gmail.com header.s=20210112 header.b=PTpgys4k; 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=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230077AbiJXEmC (ORCPT + 99 others); Mon, 24 Oct 2022 00:42:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58772 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229841AbiJXElm (ORCPT ); Mon, 24 Oct 2022 00:41:42 -0400 Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 30F172CE08; Sun, 23 Oct 2022 21:41:41 -0700 (PDT) Received: by mail-wm1-x331.google.com with SMTP id l14-20020a05600c1d0e00b003c6ecc94285so6223911wms.1; Sun, 23 Oct 2022 21:41:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=9or8BQZ5UocHwGTC/NbwWWjQgKltm58wOJFrxqGoBWI=; b=PTpgys4kBI5swR68Y7AUyEnZr2EfnF9B6E1LcOAqmqEKV7jiz0S6xMoB1I8k0/46lU Zd0f3AiU0brDdbQ1QtiUsU4oa98V2HTy3nKVxJuU12N91RUxr5vmp/VasHDmLMMJGkdF FPg/VcH1tkvNMFXfH1f+5EgmhaMFVzLJxiTd2OsloQsgl/bdOr/VPHfYl3bxvppzc3gR aTvaWHRV0nescqoleMq1joRXxd60BmyhEaayBhaY4KTeh6fb49cWb66zE5SAPxONQ0SC rWEUx1kOqYL4SOSU1wrf+cjBWdlJ2X4ho2w+Ey1Mu2F87lTQz98GILMdwsMllME9BL6q ZQUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9or8BQZ5UocHwGTC/NbwWWjQgKltm58wOJFrxqGoBWI=; b=6Cu5I29NlBsHnx0ZnJ58IZFm0eCt41nEws8j4uGzkIT7REfxsX1xrL4IAWw6YVZAXn 2fltFyJPjTKYwfksB1PeGq4wibG86AqWQPjsRFGtRYzGLBPWyTjXEA+Ntp5bGB0UNdZo FVGHKkuC4VCZqymtFGsVNGAjjL2dV+IklqG+jhKHbsDTcseXTd6aDflbjyM0qVVGP7ip /c9rtpf0X+Qrv2DKZLN/JIHBymsa7Cyj9eqsP7zcYsYk1oReqfMm2n0fRiljQ1fok/gk sDg/Djs1Qe1qJbkSZsXPBnBHKknFZaAk2BoNxY1rXNWbU+L+NNJJ3u16rrbvdTWFLlYD eNKw== X-Gm-Message-State: ACrzQf1VOwa0xAaJ4SdXQpaPChsy02wJVeA07/7hEZSgZy+ijDZUL0Mq ZXnU+s57v72ApmWrJ8G2Wu4= X-Received: by 2002:a05:600c:6008:b0:3c6:c3fa:c173 with SMTP id az8-20020a05600c600800b003c6c3fac173mr21938091wmb.190.1666586499587; Sun, 23 Oct 2022 21:41:39 -0700 (PDT) Received: from hp-power-15.localdomain (mm-197-18-212-37.vitebsk.dynamic.pppoe.byfly.by. [37.212.18.197]) by smtp.gmail.com with ESMTPSA id l39-20020a05600c1d2700b003c6deb5c1edsm9856925wms.45.2022.10.23.21.41.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Oct 2022 21:41:39 -0700 (PDT) From: Siarhei Volkau Cc: Siarhei Volkau , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Paul Cercueil , linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org Subject: [PATCH v5 3/3] clk: Add Ingenic JZ4755 CGU driver Date: Mon, 24 Oct 2022 07:40:56 +0300 Message-Id: <20221024044057.4151633-4-lis8215@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20221024044057.4151633-1-lis8215@gmail.com> References: <20221024044057.4151633-1-lis8215@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747543269918851540?= X-GMAIL-MSGID: =?utf-8?q?1747543269918851540?= Add support for the clocks provided by the CGU in the Ingenic JZ4755 SoC. Signed-off-by: Siarhei Volkau --- drivers/clk/ingenic/Kconfig | 10 + drivers/clk/ingenic/Makefile | 1 + drivers/clk/ingenic/jz4755-cgu.c | 346 +++++++++++++++++++++++++++++++ 3 files changed, 357 insertions(+) create mode 100644 drivers/clk/ingenic/jz4755-cgu.c diff --git a/drivers/clk/ingenic/Kconfig b/drivers/clk/ingenic/Kconfig index 898f1bc47..f80ac4f29 100644 --- a/drivers/clk/ingenic/Kconfig +++ b/drivers/clk/ingenic/Kconfig @@ -15,6 +15,16 @@ config INGENIC_CGU_JZ4740 If building for a JZ4740 SoC, you want to say Y here. +config INGENIC_CGU_JZ4755 + bool "Ingenic JZ4755 CGU driver" + default MACH_JZ4755 + select INGENIC_CGU_COMMON + help + Support the clocks provided by the CGU hardware on Ingenic JZ4755 + and compatible SoCs. + + If building for a JZ4755 SoC, you want to say Y here. + config INGENIC_CGU_JZ4725B bool "Ingenic JZ4725B CGU driver" default MACH_JZ4725B diff --git a/drivers/clk/ingenic/Makefile b/drivers/clk/ingenic/Makefile index 9edfaf461..81d8e23c2 100644 --- a/drivers/clk/ingenic/Makefile +++ b/drivers/clk/ingenic/Makefile @@ -1,6 +1,7 @@ # SPDX-License-Identifier: GPL-2.0-only obj-$(CONFIG_INGENIC_CGU_COMMON) += cgu.o pm.o obj-$(CONFIG_INGENIC_CGU_JZ4740) += jz4740-cgu.o +obj-$(CONFIG_INGENIC_CGU_JZ4755) += jz4755-cgu.o obj-$(CONFIG_INGENIC_CGU_JZ4725B) += jz4725b-cgu.o obj-$(CONFIG_INGENIC_CGU_JZ4760) += jz4760-cgu.o obj-$(CONFIG_INGENIC_CGU_JZ4770) += jz4770-cgu.o diff --git a/drivers/clk/ingenic/jz4755-cgu.c b/drivers/clk/ingenic/jz4755-cgu.c new file mode 100644 index 000000000..4f869efa7 --- /dev/null +++ b/drivers/clk/ingenic/jz4755-cgu.c @@ -0,0 +1,346 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Ingenic JZ4755 SoC CGU driver + * Heavily based on JZ4725b CGU driver + * + * Copyright (C) 2022 Siarhei Volkau + * Author: Siarhei Volkau + */ + +#include +#include +#include + +#include + +#include "cgu.h" +#include "pm.h" + +/* CGU register offsets */ +#define CGU_REG_CPCCR 0x00 +#define CGU_REG_LCR 0x04 +#define CGU_REG_CPPCR 0x10 +#define CGU_REG_CLKGR 0x20 +#define CGU_REG_OPCR 0x24 +#define CGU_REG_I2SCDR 0x60 +#define CGU_REG_LPCDR 0x64 +#define CGU_REG_MSCCDR 0x68 +#define CGU_REG_SSICDR 0x74 +#define CGU_REG_CIMCDR 0x7C + +/* bits within the LCR register */ +#define LCR_SLEEP BIT(0) + +static struct ingenic_cgu *cgu; + +static const s8 pll_od_encoding[4] = { + 0x0, 0x1, -1, 0x3, +}; + +static const u8 jz4755_cgu_cpccr_div_table[] = { + 1, 2, 3, 4, 6, 8, +}; + +static const u8 jz4755_cgu_pll_half_div_table[] = { + 2, 1, +}; + +static const struct ingenic_cgu_clk_info jz4755_cgu_clocks[] = { + + /* External clocks */ + + [JZ4755_CLK_EXT] = { "ext", CGU_CLK_EXT }, + [JZ4755_CLK_OSC32K] = { "osc32k", CGU_CLK_EXT }, + + [JZ4755_CLK_PLL] = { + "pll", CGU_CLK_PLL, + .parents = { JZ4755_CLK_EXT, -1, -1, -1 }, + .pll = { + .reg = CGU_REG_CPPCR, + .rate_multiplier = 1, + .m_shift = 23, + .m_bits = 9, + .m_offset = 2, + .n_shift = 18, + .n_bits = 5, + .n_offset = 2, + .od_shift = 16, + .od_bits = 2, + .od_max = 4, + .od_encoding = pll_od_encoding, + .stable_bit = 10, + .bypass_reg = CGU_REG_CPPCR, + .bypass_bit = 9, + .enable_bit = 8, + }, + }, + + /* Muxes & dividers */ + + [JZ4755_CLK_PLL_HALF] = { + "pll half", CGU_CLK_DIV, + .parents = { JZ4755_CLK_PLL, -1, -1, -1 }, + .div = { + CGU_REG_CPCCR, 21, 1, 1, -1, -1, -1, 0, + jz4755_cgu_pll_half_div_table, + }, + }, + + [JZ4755_CLK_EXT_HALF] = { + "ext half", CGU_CLK_DIV, + .parents = { JZ4755_CLK_EXT, -1, -1, -1 }, + .div = { + CGU_REG_CPCCR, 30, 1, 1, -1, -1, -1, 0, + NULL, + }, + }, + + [JZ4755_CLK_CCLK] = { + "cclk", CGU_CLK_DIV, + .parents = { JZ4755_CLK_PLL, -1, -1, -1 }, + .div = { + CGU_REG_CPCCR, 0, 1, 4, 22, -1, -1, 0, + jz4755_cgu_cpccr_div_table, + }, + }, + + [JZ4755_CLK_H0CLK] = { + "hclk", CGU_CLK_DIV, + .parents = { JZ4755_CLK_PLL, -1, -1, -1 }, + .div = { + CGU_REG_CPCCR, 4, 1, 4, 22, -1, -1, 0, + jz4755_cgu_cpccr_div_table, + }, + }, + + [JZ4755_CLK_PCLK] = { + "pclk", CGU_CLK_DIV, + .parents = { JZ4755_CLK_PLL, -1, -1, -1 }, + .div = { + CGU_REG_CPCCR, 8, 1, 4, 22, -1, -1, 0, + jz4755_cgu_cpccr_div_table, + }, + }, + + [JZ4755_CLK_MCLK] = { + "mclk", CGU_CLK_DIV, + .parents = { JZ4755_CLK_PLL, -1, -1, -1 }, + .div = { + CGU_REG_CPCCR, 12, 1, 4, 22, -1, -1, 0, + jz4755_cgu_cpccr_div_table, + }, + }, + + [JZ4755_CLK_H1CLK] = { + "h1clk", CGU_CLK_DIV, + .parents = { JZ4755_CLK_PLL, -1, -1, -1 }, + .div = { + CGU_REG_CPCCR, 16, 1, 4, 22, -1, -1, 0, + jz4755_cgu_cpccr_div_table, + }, + }, + + [JZ4755_CLK_UDC] = { + "udc", CGU_CLK_MUX | CGU_CLK_DIV | CGU_CLK_GATE, + .parents = { JZ4755_CLK_EXT_HALF, JZ4755_CLK_PLL_HALF, -1, -1 }, + .mux = { CGU_REG_CPCCR, 29, 1 }, + .div = { CGU_REG_CPCCR, 23, 1, 6, -1, -1, -1 }, + .gate = { CGU_REG_CLKGR, 10 }, + }, + + [JZ4755_CLK_LCD] = { + "lcd", CGU_CLK_DIV | CGU_CLK_GATE, + .parents = { JZ4755_CLK_PLL_HALF, -1, -1, -1 }, + .div = { CGU_REG_LPCDR, 0, 1, 11, -1, -1, -1 }, + .gate = { CGU_REG_CLKGR, 9 }, + }, + + [JZ4755_CLK_MMC] = { + "mmc", CGU_CLK_DIV, + .parents = { JZ4755_CLK_PLL_HALF, -1, -1, -1 }, + .div = { CGU_REG_MSCCDR, 0, 1, 5, -1, -1, -1 }, + }, + + [JZ4755_CLK_I2S] = { + "i2s", CGU_CLK_MUX | CGU_CLK_DIV, + .parents = { JZ4755_CLK_EXT_HALF, JZ4755_CLK_PLL_HALF, -1, -1 }, + .mux = { CGU_REG_CPCCR, 31, 1 }, + .div = { CGU_REG_I2SCDR, 0, 1, 9, -1, -1, -1 }, + }, + + [JZ4755_CLK_SPI] = { + "spi", CGU_CLK_DIV | CGU_CLK_GATE, + .parents = { JZ4755_CLK_PLL_HALF, -1, -1, -1 }, + .div = { CGU_REG_SSICDR, 0, 1, 4, -1, -1, -1 }, + .gate = { CGU_REG_CLKGR, 4 }, + }, + + [JZ4755_CLK_TVE] = { + "tve", CGU_CLK_MUX | CGU_CLK_GATE, + .parents = { JZ4755_CLK_LCD, JZ4755_CLK_EXT, -1, -1 }, + .mux = { CGU_REG_LPCDR, 31, 1 }, + .gate = { CGU_REG_CLKGR, 18 }, + }, + + [JZ4755_CLK_RTC] = { + "rtc", CGU_CLK_MUX | CGU_CLK_GATE, + .parents = { JZ4755_CLK_EXT512, JZ4755_CLK_OSC32K, -1, -1 }, + .mux = { CGU_REG_OPCR, 2, 1}, + .gate = { CGU_REG_CLKGR, 2 }, + }, + + [JZ4755_CLK_CIM] = { + "cim", CGU_CLK_DIV | CGU_CLK_GATE, + .parents = { JZ4755_CLK_PLL_HALF, -1, -1, -1 }, + .div = { CGU_REG_CIMCDR, 0, 1, 8, -1, -1, -1 }, + .gate = { CGU_REG_CLKGR, 8 }, + }, + + /* Gate-only clocks */ + + [JZ4755_CLK_UART0] = { + "uart0", CGU_CLK_GATE, + .parents = { JZ4755_CLK_EXT_HALF, -1, -1, -1 }, + .gate = { CGU_REG_CLKGR, 0 }, + }, + + [JZ4755_CLK_UART1] = { + "uart1", CGU_CLK_GATE, + .parents = { JZ4755_CLK_EXT_HALF, -1, -1, -1 }, + .gate = { CGU_REG_CLKGR, 14 }, + }, + + [JZ4755_CLK_UART2] = { + "uart2", CGU_CLK_GATE, + .parents = { JZ4755_CLK_EXT_HALF, -1, -1, -1 }, + .gate = { CGU_REG_CLKGR, 15 }, + }, + + [JZ4755_CLK_ADC] = { + "adc", CGU_CLK_GATE, + .parents = { JZ4755_CLK_EXT_HALF, -1, -1, -1 }, + .gate = { CGU_REG_CLKGR, 7 }, + }, + + [JZ4755_CLK_AIC] = { + "aic", CGU_CLK_GATE, + .parents = { JZ4755_CLK_EXT_HALF, -1, -1, -1 }, + .gate = { CGU_REG_CLKGR, 5 }, + }, + + [JZ4755_CLK_I2C] = { + "i2c", CGU_CLK_GATE, + .parents = { JZ4755_CLK_EXT_HALF, -1, -1, -1 }, + .gate = { CGU_REG_CLKGR, 3 }, + }, + + [JZ4755_CLK_BCH] = { + "bch", CGU_CLK_GATE, + .parents = { JZ4755_CLK_MCLK/* not sure */, -1, -1, -1 }, + .gate = { CGU_REG_CLKGR, 11 }, + }, + + [JZ4755_CLK_TCU] = { + "tcu", CGU_CLK_GATE, + .parents = { JZ4755_CLK_EXT, -1, -1, -1 }, + .gate = { CGU_REG_CLKGR, 1 }, + }, + + [JZ4755_CLK_DMA] = { + "dma", CGU_CLK_GATE, + .parents = { JZ4755_CLK_PCLK, -1, -1, -1 }, + .gate = { CGU_REG_CLKGR, 12 }, + }, + + [JZ4755_CLK_MMC0] = { + "mmc0", CGU_CLK_GATE, + .parents = { JZ4755_CLK_MMC, -1, -1, -1 }, + .gate = { CGU_REG_CLKGR, 6 }, + }, + + [JZ4755_CLK_MMC1] = { + "mmc1", CGU_CLK_GATE, + .parents = { JZ4755_CLK_MMC, -1, -1, -1 }, + .gate = { CGU_REG_CLKGR, 16 }, + }, + + [JZ4755_CLK_AUX_CPU] = { + "aux_cpu", CGU_CLK_GATE, + .parents = { JZ4755_CLK_H1CLK, -1, -1, -1 }, + .gate = { CGU_REG_CLKGR, 24 }, + }, + + [JZ4755_CLK_AHB1] = { + "ahb1", CGU_CLK_GATE, + .parents = { JZ4755_CLK_H1CLK, -1, -1, -1 }, + .gate = { CGU_REG_CLKGR, 23 }, + }, + + [JZ4755_CLK_IDCT] = { + "idct", CGU_CLK_GATE, + .parents = { JZ4755_CLK_H1CLK, -1, -1, -1 }, + .gate = { CGU_REG_CLKGR, 22 }, + }, + + [JZ4755_CLK_DB] = { + "db", CGU_CLK_GATE, + .parents = { JZ4755_CLK_H1CLK, -1, -1, -1 }, + .gate = { CGU_REG_CLKGR, 21 }, + }, + + [JZ4755_CLK_ME] = { + "me", CGU_CLK_GATE, + .parents = { JZ4755_CLK_H1CLK, -1, -1, -1 }, + .gate = { CGU_REG_CLKGR, 20 }, + }, + + [JZ4755_CLK_MC] = { + "mc", CGU_CLK_GATE, + .parents = { JZ4755_CLK_H1CLK, -1, -1, -1 }, + .gate = { CGU_REG_CLKGR, 19 }, + }, + + [JZ4755_CLK_TSSI] = { + "tssi", CGU_CLK_GATE, + .parents = { JZ4755_CLK_EXT_HALF/* not sure */, -1, -1, -1 }, + .gate = { CGU_REG_CLKGR, 17 }, + }, + + [JZ4755_CLK_IPU] = { + "ipu", CGU_CLK_GATE, + .parents = { JZ4755_CLK_PLL_HALF/* not sure */, -1, -1, -1 }, + .gate = { CGU_REG_CLKGR, 13 }, + }, + + [JZ4755_CLK_EXT512] = { + "ext/512", CGU_CLK_FIXDIV, + .parents = { JZ4755_CLK_EXT }, + + .fixdiv = { 512 }, + }, + + [JZ4755_CLK_UDC_PHY] = { + "udc_phy", CGU_CLK_GATE, + .parents = { JZ4755_CLK_EXT_HALF, -1, -1, -1 }, + .gate = { CGU_REG_OPCR, 6, true }, + }, +}; + +static void __init jz4755_cgu_init(struct device_node *np) +{ + int retval; + + cgu = ingenic_cgu_new(jz4755_cgu_clocks, + ARRAY_SIZE(jz4755_cgu_clocks), np); + if (!cgu) { + pr_err("%s: failed to initialise CGU\n", __func__); + return; + } + + retval = ingenic_cgu_register_clocks(cgu); + if (retval) + pr_err("%s: failed to register CGU Clocks\n", __func__); + + ingenic_cgu_register_syscore_ops(cgu); +} +CLK_OF_DECLARE_DRIVER(jz4755_cgu, "ingenic,jz4755-cgu", jz4755_cgu_init);