From nobody Tue Dec 16 16:42:07 2025 Received: from mail-ot1-f44.google.com (mail-ot1-f44.google.com [209.85.210.44]) (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 5D84716DC1F for ; Thu, 11 Jul 2024 16:56:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720716990; cv=none; b=FBepWirlQk/Lv8Dr1092xBcZNVqp5KW9YzGHiOvStCCZqTeugBLHZZoAYJNlnNu+0i+7ONBLp6GObm9R8Y1Wa7q//SstwShP/+VTt/aUOVG38eQ/IXIFXeUsb0u7XDcZonv7TaQq/KMB3rlQNSTG62uymmCO18Iru/zrIwnG1BM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720716990; c=relaxed/simple; bh=33rJGU2InhpHnNryWyQ6zmKtIVWZTaHsLeFjChtPSYE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=poSBq7J6MkQZDy4ufAtbSfH38RgZ43+6+xeRO+W+239uOiT1bJaxqSUYM7TulFr3U+cplZsfdbnxZnA/6RjUYy8j5F+9wWVcrMxxx6i/sv8UiZNILWzz23qeCV6iX3WCezztwE5BteB2V+eJ7OpBUKpYGvBRQMPNvknPfr9i42o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=tenstorrent.com; spf=pass smtp.mailfrom=tenstorrent.com; dkim=pass (2048-bit key) header.d=tenstorrent.com header.i=@tenstorrent.com header.b=UcyEF6IW; arc=none smtp.client-ip=209.85.210.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=tenstorrent.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tenstorrent.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tenstorrent.com header.i=@tenstorrent.com header.b="UcyEF6IW" Received: by mail-ot1-f44.google.com with SMTP id 46e09a7af769-6f8d0a1e500so845227a34.3 for ; Thu, 11 Jul 2024 09:56:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tenstorrent.com; s=google; t=1720716987; x=1721321787; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=OAoZ+kq55SzE5WBx9TKdQ/R9FJjcK6MhUYBG9cAxnls=; b=UcyEF6IWfJukPYaRVthumki8O7TeA6KAhP3IGnaF2ewPB0U3SnMLjROj/AXcEqvyhq HzkI0GzapBQk8dCMXEGSBnhVziefaUytI7A3AOvQD2F9GynwA34OBF8D2Y6WzdvcCIE6 EsK4aYdTkxCp0D7KUBFbAVVfFT7DtL7v0U/ur8WiRi1zKP6NQhpxOn1nvvOsZ1PTxujI 4VLs/47qDKnw6AQAgjNwU9DFAAs64+uCn3lnUK8g5eitG28QnbbdEeIcBqq/fj7SEdTa aJjsWvPkFHFMgQ4gx2uX8Wo3ls9XMGzSw7wCww6DnB/OGCyeLF/eHJ/h6wxlEsalpfbQ Zd+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720716987; x=1721321787; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=OAoZ+kq55SzE5WBx9TKdQ/R9FJjcK6MhUYBG9cAxnls=; b=Q7XYlYQe5fkkHEfOWP4J1zDLbMBk/e/mzid78JCBVhjSyPSEm5GWs3zDPl3iBYaFvd pqjM12HVKMbYY8JZrj+cNawhvkL+fnpiT6+uSawx4a9b+cbJTDatfgbarG9fcw+64v9N iHCobuY/DpKAf2cLubZmSZOPgS3M0ntCPE3sczYcdf0RzAj4dtnLrU4XxZYLYuiw3N+a LgsbkWGtgxpQ3stos2uiVJkjt1Ccy3j/sOd5PPVi3djFq0zZOwfuKzkNgOkyP/tSLudR aLdO9AOw7Q6TMBOuNDWHrzjJpgAGcIcHemQGJRWx/lJKUJw6AqwKpL3Du6FWRQ9hTjoQ 7xpw== X-Forwarded-Encrypted: i=1; AJvYcCXoc4ZFjcICquapEv2VxsZ2SWv5oyUJMSEnnFPccpozq6zUOHxUVt+Nwkr1iGahxZgXXXI1HmIA7zfQV1uctJWP5ryFWgTQDrwsQTrp X-Gm-Message-State: AOJu0YzptyiXh9N9aDSLEwW0ARmHouaYySNo1qT9gKQA3rgL70kz69Z/ hTapfFquFNh6aVt3bAqRMVvhVR35GeavS94phEGJMkf5r3tJusfL7gkDvZX1uRI= X-Google-Smtp-Source: AGHT+IEtRPHy2o85PmOJzrWYS6qIrfxXn4kafltJOvylpbKq2XolD1MMytvOuQr0Gsz2YP8CIaHzsA== X-Received: by 2002:a05:6358:fd04:b0:1a6:7af3:22ce with SMTP id e5c5f4694b2df-1aade08fa4cmr705244555d.2.1720716987411; Thu, 11 Jul 2024 09:56:27 -0700 (PDT) Received: from [127.0.1.1] ([2601:1c2:1802:170:5ee9:fea0:d9de:cee8]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-787089bc5f6sm1360038a12.92.2024.07.11.09.56.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Jul 2024 09:56:27 -0700 (PDT) From: Drew Fustini Date: Thu, 11 Jul 2024 09:56:19 -0700 Subject: [PATCH v3 1/7] dt-bindings: clock: Document T-Head TH1520 AP_SUBSYS controller Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20240711-th1520-clk-v3-1-6ff17bb318fb@tenstorrent.com> References: <20240711-th1520-clk-v3-0-6ff17bb318fb@tenstorrent.com> In-Reply-To: <20240711-th1520-clk-v3-0-6ff17bb318fb@tenstorrent.com> To: Jisheng Zhang , Guo Ren , Fu Wei , Yangtao Li , Thomas Bonnefille , Emil Renner Berthing , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Paul Walmsley , Palmer Dabbelt , Albert Ou Cc: linux-riscv@lists.infradead.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Conor Dooley , Drew Fustini X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1720716985; l=5553; i=dfustini@tenstorrent.com; s=20230430; h=from:subject:message-id; bh=33rJGU2InhpHnNryWyQ6zmKtIVWZTaHsLeFjChtPSYE=; b=6YAGcBp4Fm9bDRfTyXOB2NmXl5D6Sd8k1BQlNn3GXGmffpByWrS3UBfAhRFPbzG1K88DFfOOk Pp+pLKSlzibCYiSEM2kmtnt2eZFEehe7vftYoT7cE1swIeVaeNEnZCw X-Developer-Key: i=dfustini@tenstorrent.com; a=ed25519; pk=p3GKE9XFmjhwAayAHG4U108yag7V8xQVd4zJLdW0g7g= Document bindings for the T-Head TH1520 AP sub-system clock controller. Link: https://openbeagle.org/beaglev-ahead/beaglev-ahead/-/blob/main/docs/T= H1520%20System%20User%20Manual.pdf Co-developed-by: Yangtao Li Signed-off-by: Yangtao Li Reviewed-by: Conor Dooley Signed-off-by: Drew Fustini --- .../bindings/clock/thead,th1520-clk-ap.yaml | 53 ++++++++++++ MAINTAINERS | 2 + include/dt-bindings/clock/thead,th1520-clk-ap.h | 96 ++++++++++++++++++= ++++ 3 files changed, 151 insertions(+) diff --git a/Documentation/devicetree/bindings/clock/thead,th1520-clk-ap.ya= ml b/Documentation/devicetree/bindings/clock/thead,th1520-clk-ap.yaml new file mode 100644 index 000000000000..0129bd0ba4b3 --- /dev/null +++ b/Documentation/devicetree/bindings/clock/thead,th1520-clk-ap.yaml @@ -0,0 +1,53 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/clock/thead,th1520-clk-ap.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: T-HEAD TH1520 AP sub-system clock controller + +description: | + The T-HEAD TH1520 AP sub-system clock controller configures the + CPU, DPU, GMAC and TEE PLLs. + + SoC reference manual + https://openbeagle.org/beaglev-ahead/beaglev-ahead/-/blob/main/docs/TH15= 20%20System%20User%20Manual.pdf + +maintainers: + - Jisheng Zhang + - Wei Fu + - Drew Fustini + +properties: + compatible: + const: thead,th1520-clk-ap + + reg: + maxItems: 1 + + clocks: + items: + - description: main oscillator (24MHz) + + "#clock-cells": + const: 1 + description: + See for valid indices. + +required: + - compatible + - reg + - clocks + - "#clock-cells" + +additionalProperties: false + +examples: + - | + #include + clock-controller@ef010000 { + compatible =3D "thead,th1520-clk-ap"; + reg =3D <0xef010000 0x1000>; + clocks =3D <&osc>; + #clock-cells =3D <1>; + }; diff --git a/MAINTAINERS b/MAINTAINERS index da5352dbd4f3..5b0e9c3534ea 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -19318,7 +19318,9 @@ M: Guo Ren M: Fu Wei L: linux-riscv@lists.infradead.org S: Maintained +F: Documentation/devicetree/bindings/clock/thead,th1520-clk-ap.yaml F: arch/riscv/boot/dts/thead/ +F: include/dt-bindings/clock/thead,th1520-clk-ap.h =20 RNBD BLOCK DRIVERS M: Md. Haris Iqbal diff --git a/include/dt-bindings/clock/thead,th1520-clk-ap.h b/include/dt-b= indings/clock/thead,th1520-clk-ap.h new file mode 100644 index 000000000000..a199784b3512 --- /dev/null +++ b/include/dt-bindings/clock/thead,th1520-clk-ap.h @@ -0,0 +1,96 @@ +/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */ +/* + * Copyright (C) 2023 Vivo Communication Technology Co. Ltd. + * Authors: Yangtao Li + */ + +#ifndef _DT_BINDINGS_CLK_TH1520_H_ +#define _DT_BINDINGS_CLK_TH1520_H_ + +#define CLK_CPU_PLL0 0 +#define CLK_CPU_PLL1 1 +#define CLK_GMAC_PLL 2 +#define CLK_VIDEO_PLL 3 +#define CLK_DPU0_PLL 4 +#define CLK_DPU1_PLL 5 +#define CLK_TEE_PLL 6 +#define CLK_C910_I0 7 +#define CLK_C910 8 +#define CLK_BROM 9 +#define CLK_BMU 10 +#define CLK_AHB2_CPUSYS_HCLK 11 +#define CLK_APB3_CPUSYS_PCLK 12 +#define CLK_AXI4_CPUSYS2_ACLK 13 +#define CLK_AON2CPU_A2X 14 +#define CLK_X2X_CPUSYS 15 +#define CLK_AXI_ACLK 16 +#define CLK_CPU2AON_X2H 17 +#define CLK_PERI_AHB_HCLK 18 +#define CLK_CPU2PERI_X2H 19 +#define CLK_PERI_APB_PCLK 20 +#define CLK_PERI2APB_PCLK 21 +#define CLK_PERISYS_APB1_HCLK 22 +#define CLK_PERISYS_APB2_HCLK 23 +#define CLK_PERISYS_APB3_HCLK 24 +#define CLK_PERISYS_APB4_HCLK 25 +#define CLK_OSC12M 26 +#define CLK_OUT1 27 +#define CLK_OUT2 28 +#define CLK_OUT3 29 +#define CLK_OUT4 30 +#define CLK_APB_PCLK 31 +#define CLK_NPU 32 +#define CLK_NPU_AXI 33 +#define CLK_VI 34 +#define CLK_VI_AHB 35 +#define CLK_VO_AXI 36 +#define CLK_VP_APB 37 +#define CLK_VP_AXI 38 +#define CLK_CPU2VP 39 +#define CLK_VENC 40 +#define CLK_DPU0 41 +#define CLK_DPU1 42 +#define CLK_EMMC_SDIO 43 +#define CLK_GMAC1 44 +#define CLK_PADCTRL1 45 +#define CLK_DSMART 46 +#define CLK_PADCTRL0 47 +#define CLK_GMAC_AXI 48 +#define CLK_GPIO3 49 +#define CLK_GMAC0 50 +#define CLK_PWM 51 +#define CLK_QSPI0 52 +#define CLK_QSPI1 53 +#define CLK_SPI 54 +#define CLK_UART0_PCLK 55 +#define CLK_UART1_PCLK 56 +#define CLK_UART2_PCLK 57 +#define CLK_UART3_PCLK 58 +#define CLK_UART4_PCLK 59 +#define CLK_UART5_PCLK 60 +#define CLK_GPIO0 61 +#define CLK_GPIO1 62 +#define CLK_GPIO2 63 +#define CLK_I2C0 64 +#define CLK_I2C1 65 +#define CLK_I2C2 66 +#define CLK_I2C3 67 +#define CLK_I2C4 68 +#define CLK_I2C5 69 +#define CLK_SPINLOCK 70 +#define CLK_DMA 71 +#define CLK_MBOX0 72 +#define CLK_MBOX1 73 +#define CLK_MBOX2 74 +#define CLK_MBOX3 75 +#define CLK_WDT0 76 +#define CLK_WDT1 77 +#define CLK_TIMER0 78 +#define CLK_TIMER1 79 +#define CLK_SRAM0 80 +#define CLK_SRAM1 81 +#define CLK_SRAM2 82 +#define CLK_SRAM3 83 +#define CLK_PLL_GMAC_100M 84 +#define CLK_UART_SCLK 85 +#endif --=20 2.34.1 From nobody Tue Dec 16 16:42:07 2025 Received: from mail-ot1-f43.google.com (mail-ot1-f43.google.com [209.85.210.43]) (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 7E75116DC29 for ; Thu, 11 Jul 2024 16:56:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720716993; cv=none; b=ru/xihhC5FMqeKZQEomnHin6vemvYdgLIZnt6GAqyP6PlifqW+GTw8aOuJo5UwvKKf1mhGQrKmBGcg8a1Jc+cRzqCgBn15RF92b4svifP/64LzOG6v7wTEcoswEuiLBPOUs2/FAt3psT+Rxw7vB6GRGxNeMzFGrVzxDjmPn3BdI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720716993; c=relaxed/simple; bh=IrtuGBJvCZGVa3Nq4NW6lfX6QeGmdWStLttfoRlRz2c=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=XkTeg4r5FoLAAuJECeJ4rQQaEExq6jbqThtEMR2XxCanypZrYRlAfS+CJ0rVQ97dFpAHB7PeGSQtwwfyenuK7FmrDqu0ki7Gd7YnlHDQdvbYZNfzIoMYE8niWbd6HuqHa5EV94PIM2AXtvSIzs9ReR5xnqUsQuMMtOXkSGSPrtg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=tenstorrent.com; spf=pass smtp.mailfrom=tenstorrent.com; dkim=pass (2048-bit key) header.d=tenstorrent.com header.i=@tenstorrent.com header.b=ghv3RhJe; arc=none smtp.client-ip=209.85.210.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=tenstorrent.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tenstorrent.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tenstorrent.com header.i=@tenstorrent.com header.b="ghv3RhJe" Received: by mail-ot1-f43.google.com with SMTP id 46e09a7af769-7039e4a4a03so649122a34.3 for ; Thu, 11 Jul 2024 09:56:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tenstorrent.com; s=google; t=1720716988; x=1721321788; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=nQScDX0pAiuyFU1/c4gNHehqt34YIpM6usSiM6TmW7Y=; b=ghv3RhJez2Bpb2fLFrXnvrSkMt7tyF8SZ9j6ZKKfo8vj2oQkm6Z2ZBRgB7jlX5JpoM iYKY5OwlxflyYPT0lJZyDXULW4O/oQeIRSFvvT+v+rDhZiv1cc9Z9G+vO43z8QHjOM+H /vOlYaxHkP4Dod0FHLWCEFR8iD+4QJBx3tT8QKj4n2qoPnYF7fSvLOeIL7GHPz6xt2GF 97bqivY51xnMaAFnfn2OJN5GTNTUaheInGMNkzz/WGiDxfDkeDkc5DTwHUoT3dMJOCew C0mM0rTbHT89GlKWRikDDq+clq+EfVOWQcguPlxn5BzplrVHVf1UOIwSfI+P3VyA9lPE a0iA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720716988; x=1721321788; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nQScDX0pAiuyFU1/c4gNHehqt34YIpM6usSiM6TmW7Y=; b=nEhYmkuLqBnkkGSw1Q2NHpPGnOSM4Tg+qIKusc6PARBG7c+SKOXrDQIR0uktVxdvy/ o4tlffWVll5wm7aKHqaov8Qh+jS7fCuIuflGVBstsWCz63rfBPUVgB20ZYrT1N+MvYeb yMAgFhpGnwu4D8L9AQBeO4Kt7hiXO22bdJd1t4hCFerigfych9OayT4wdMj9horXkABa m8UKUD4Qy2BAZdMrTPT+bZvAilFr5jkMzeaypNpy9+kcughcMaVnhgK3HnTFG6jnw3gw ezFuAz4MLlpH4GtUFoopFWDHbGlN+bJq+Ka0a2wYd/vDi9lVavTe+wMhMkNnFhjbNF1a rnIQ== X-Forwarded-Encrypted: i=1; AJvYcCWJAMp1YcROq8AcluotYwpmAoJSKPbF9Snk/TTKVv/Mzh7+tFuCl7f+lpLi7zT8zGe49wDMdS8NGOU2Qtr+Dyi7DMwzTZHFegVs5z6V X-Gm-Message-State: AOJu0YwdRCI+FZSMs17Rfu+HsKcZtMzx1b6clHViSg8wgNPcn9MVx6DX fbN8/PjWK3D8E/CpE/fqC+tjo1GejlJryJIFDX7oUo2LdXWicx8oM00rVLgVwPk= X-Google-Smtp-Source: AGHT+IHm2BtXpyIi6RZ3xqC/s+MpoynuwrPBIAfCORVZCiqfa9fXpmmyqEjj8owTogXmLrK5dMkprg== X-Received: by 2002:a05:6870:d612:b0:25e:8509:160e with SMTP id 586e51a60fabf-25eae74a09amr7993207fac.3.1720716988400; Thu, 11 Jul 2024 09:56:28 -0700 (PDT) Received: from [127.0.1.1] ([2601:1c2:1802:170:5ee9:fea0:d9de:cee8]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-787089bc5f6sm1360038a12.92.2024.07.11.09.56.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Jul 2024 09:56:28 -0700 (PDT) From: Drew Fustini Date: Thu, 11 Jul 2024 09:56:20 -0700 Subject: [PATCH v3 2/7] clk: thead: Add support for T-Head TH1520 AP_SUBSYS clocks Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20240711-th1520-clk-v3-2-6ff17bb318fb@tenstorrent.com> References: <20240711-th1520-clk-v3-0-6ff17bb318fb@tenstorrent.com> In-Reply-To: <20240711-th1520-clk-v3-0-6ff17bb318fb@tenstorrent.com> To: Jisheng Zhang , Guo Ren , Fu Wei , Yangtao Li , Thomas Bonnefille , Emil Renner Berthing , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Paul Walmsley , Palmer Dabbelt , Albert Ou Cc: linux-riscv@lists.infradead.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Drew Fustini X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1720716985; l=33786; i=dfustini@tenstorrent.com; s=20230430; h=from:subject:message-id; bh=IrtuGBJvCZGVa3Nq4NW6lfX6QeGmdWStLttfoRlRz2c=; b=NH3KuYy7RR1Tz/pQKrGaiLMKNCya7Vb42zoJFpkir0wcPDneRBC1fmaHF8zXFaFbMY8dYm21h zgTnLo7dfzXBImpKM6NTw/5KMU21cnE0qSjIaVOjJkCrKIabK1o5nbF X-Developer-Key: i=dfustini@tenstorrent.com; a=ed25519; pk=p3GKE9XFmjhwAayAHG4U108yag7V8xQVd4zJLdW0g7g= Add support for the AP sub-system clock controller in the T-Head TH1520. This include CPU, DPU, GMAC and TEE PLLs. Link: https://openbeagle.org/beaglev-ahead/beaglev-ahead/-/blob/main/docs/T= H1520%20System%20User%20Manual.pdf Co-developed-by: Yangtao Li Signed-off-by: Yangtao Li Co-developed-by: Jisheng Zhang Signed-off-by: Jisheng Zhang Link: https://git.beagleboard.org/beaglev-ahead/beaglev-ahead/-/tree/main/d= ocs Signed-off-by: Drew Fustini --- MAINTAINERS | 1 + drivers/clk/Kconfig | 1 + drivers/clk/Makefile | 1 + drivers/clk/thead/Kconfig | 12 + drivers/clk/thead/Makefile | 2 + drivers/clk/thead/clk-th1520-ap.c | 1089 +++++++++++++++++++++++++++++++++= ++++ 6 files changed, 1106 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 5b0e9c3534ea..bbe925242eb9 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -19320,6 +19320,7 @@ L: linux-riscv@lists.infradead.org S: Maintained F: Documentation/devicetree/bindings/clock/thead,th1520-clk-ap.yaml F: arch/riscv/boot/dts/thead/ +F: drivers/clk/thead/clk-th1520-ap.c F: include/dt-bindings/clock/thead,th1520-clk-ap.h =20 RNBD BLOCK DRIVERS diff --git a/drivers/clk/Kconfig b/drivers/clk/Kconfig index 3e9099504fad..d73ae04e427a 100644 --- a/drivers/clk/Kconfig +++ b/drivers/clk/Kconfig @@ -495,6 +495,7 @@ source "drivers/clk/starfive/Kconfig" source "drivers/clk/sunxi/Kconfig" source "drivers/clk/sunxi-ng/Kconfig" source "drivers/clk/tegra/Kconfig" +source "drivers/clk/thead/Kconfig" source "drivers/clk/stm32/Kconfig" source "drivers/clk/ti/Kconfig" source "drivers/clk/uniphier/Kconfig" diff --git a/drivers/clk/Makefile b/drivers/clk/Makefile index 4abe16c8ccdf..f793a16cad40 100644 --- a/drivers/clk/Makefile +++ b/drivers/clk/Makefile @@ -127,6 +127,7 @@ obj-y +=3D starfive/ obj-$(CONFIG_ARCH_SUNXI) +=3D sunxi/ obj-y +=3D sunxi-ng/ obj-$(CONFIG_ARCH_TEGRA) +=3D tegra/ +obj-$(CONFIG_ARCH_THEAD) +=3D thead/ obj-y +=3D ti/ obj-$(CONFIG_CLK_UNIPHIER) +=3D uniphier/ obj-$(CONFIG_ARCH_U8500) +=3D ux500/ diff --git a/drivers/clk/thead/Kconfig b/drivers/clk/thead/Kconfig new file mode 100644 index 000000000000..1710d50bf9d4 --- /dev/null +++ b/drivers/clk/thead/Kconfig @@ -0,0 +1,12 @@ +#SPDX-License-Identifier: GPL-2.0 + +config CLK_THEAD_TH1520_AP + bool "T-HEAD TH1520 AP clock support" + depends on ARCH_THEAD || COMPILE_TEST + default ARCH_THEAD + select REGMAP_MMIO + help + Say yes here to support the AP sub system clock controller + on the T-HEAD TH1520 SoC. This includes configuration of + both CPU PLLs, both DPU PLLs as well as the GMAC, VIDEO, + and TEE PLLs. diff --git a/drivers/clk/thead/Makefile b/drivers/clk/thead/Makefile new file mode 100644 index 000000000000..7ee0bec1f251 --- /dev/null +++ b/drivers/clk/thead/Makefile @@ -0,0 +1,2 @@ +# SPDX-License-Identifier: GPL-2.0 +obj-$(CONFIG_CLK_THEAD_TH1520_AP) +=3D clk-th1520-ap.o diff --git a/drivers/clk/thead/clk-th1520-ap.c b/drivers/clk/thead/clk-th15= 20-ap.c new file mode 100644 index 000000000000..e6401e198517 --- /dev/null +++ b/drivers/clk/thead/clk-th1520-ap.c @@ -0,0 +1,1089 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2023 Jisheng Zhang + * Copyright (C) 2023 Vivo Communication Technology Co. Ltd. + * Authors: Yangtao Li + */ + +#include +#include +#include +#include +#include +#include +#include + +#define TH1520_PLL_POSTDIV2 GENMASK(26, 24) +#define TH1520_PLL_POSTDIV1 GENMASK(22, 20) +#define TH1520_PLL_FBDIV GENMASK(19, 8) +#define TH1520_PLL_REFDIV GENMASK(5, 0) +#define TH1520_PLL_BYPASS BIT(30) +#define TH1520_PLL_DSMPD BIT(24) +#define TH1520_PLL_FRAC GENMASK(23, 0) +#define TH1520_PLL_FRAC_BITS 24 + +struct ccu_internal { + u8 shift; + u8 width; +}; + +struct ccu_div_internal { + u8 shift; + u8 width; + u32 flags; +}; + +struct ccu_common { + int clkid; + struct regmap *map; + u16 cfg0; + u16 cfg1; + struct clk_hw hw; +}; + +struct ccu_mux { + struct ccu_internal mux; + struct ccu_common common; +}; + +struct ccu_gate { + u32 enable; + struct ccu_common common; +}; + +struct ccu_div { + u32 enable; + struct ccu_div_internal div; + struct ccu_internal mux; + struct ccu_common common; +}; + +struct ccu_pll { + struct ccu_common common; +}; + +#define TH_CCU_ARG(_shift, _width) \ + { \ + .shift =3D _shift, \ + .width =3D _width, \ + } + +#define TH_CCU_DIV_FLAGS(_shift, _width, _flags) \ + { \ + .shift =3D _shift, \ + .width =3D _width, \ + .flags =3D _flags, \ + } + +#define CCU_GATE(_clkid, _struct, _name, _parent, _reg, _gate, _flags) \ + struct ccu_gate _struct =3D { \ + .enable =3D _gate, \ + .common =3D { \ + .clkid =3D _clkid, \ + .cfg0 =3D _reg, \ + .hw.init =3D CLK_HW_INIT_PARENTS_DATA( \ + _name, \ + _parent, \ + &clk_gate_ops, \ + _flags), \ + } \ + } + +static inline struct ccu_common *hw_to_ccu_common(struct clk_hw *hw) +{ + return container_of(hw, struct ccu_common, hw); +} + +static inline struct ccu_mux *hw_to_ccu_mux(struct clk_hw *hw) +{ + struct ccu_common *common =3D hw_to_ccu_common(hw); + + return container_of(common, struct ccu_mux, common); +} + +static inline struct ccu_pll *hw_to_ccu_pll(struct clk_hw *hw) +{ + struct ccu_common *common =3D hw_to_ccu_common(hw); + + return container_of(common, struct ccu_pll, common); +} + +static inline struct ccu_div *hw_to_ccu_div(struct clk_hw *hw) +{ + struct ccu_common *common =3D hw_to_ccu_common(hw); + + return container_of(common, struct ccu_div, common); +} + +static inline struct ccu_gate *hw_to_ccu_gate(struct clk_hw *hw) +{ + struct ccu_common *common =3D hw_to_ccu_common(hw); + + return container_of(common, struct ccu_gate, common); +} + +static u8 ccu_get_parent_helper(struct ccu_common *common, + struct ccu_internal *mux) +{ + unsigned int val; + u8 parent; + + regmap_read(common->map, common->cfg0, &val); + parent =3D val >> mux->shift; + parent &=3D GENMASK(mux->width - 1, 0); + + return parent; +} + +static int ccu_set_parent_helper(struct ccu_common *common, + struct ccu_internal *mux, + u8 index) +{ + return regmap_update_bits(common->map, common->cfg0, + GENMASK(mux->width - 1, 0) << mux->shift, + index << mux->shift); +} + +static void ccu_disable_helper(struct ccu_common *common, u32 gate) +{ + if (!gate) + return; + regmap_update_bits(common->map, common->cfg0, + gate, ~gate); +} + +static int ccu_enable_helper(struct ccu_common *common, u32 gate) +{ + unsigned int val; + int ret; + + if (!gate) + return 0; + + ret =3D regmap_update_bits(common->map, common->cfg0, gate, gate); + regmap_read(common->map, common->cfg0, &val); + return ret; +} + +static int ccu_is_enabled_helper(struct ccu_common *common, u32 gate) +{ + unsigned int val; + + if (!gate) + return true; + + regmap_read(common->map, common->cfg0, &val); + return val & gate; +} + +static unsigned long ccu_div_recalc_rate(struct clk_hw *hw, + unsigned long parent_rate) +{ + struct ccu_div *cd =3D hw_to_ccu_div(hw); + unsigned long rate; + unsigned int val; + + regmap_read(cd->common.map, cd->common.cfg0, &val); + val =3D val >> cd->div.shift; + val &=3D GENMASK(cd->div.width - 1, 0); + rate =3D divider_recalc_rate(hw, parent_rate, val, NULL, + cd->div.flags, cd->div.width); + + return rate; +} + +static u8 ccu_div_get_parent(struct clk_hw *hw) +{ + struct ccu_div *cd =3D hw_to_ccu_div(hw); + + return ccu_get_parent_helper(&cd->common, &cd->mux); +} + +static int ccu_div_set_parent(struct clk_hw *hw, u8 index) +{ + struct ccu_div *cd =3D hw_to_ccu_div(hw); + + return ccu_set_parent_helper(&cd->common, &cd->mux, index); +} + +static void ccu_div_disable(struct clk_hw *hw) +{ + struct ccu_div *cd =3D hw_to_ccu_div(hw); + + ccu_disable_helper(&cd->common, cd->enable); +} + +static int ccu_div_enable(struct clk_hw *hw) +{ + struct ccu_div *cd =3D hw_to_ccu_div(hw); + + return ccu_enable_helper(&cd->common, cd->enable); +} + +static int ccu_div_is_enabled(struct clk_hw *hw) +{ + struct ccu_div *cd =3D hw_to_ccu_div(hw); + + return ccu_is_enabled_helper(&cd->common, cd->enable); +} + +static const struct clk_ops ccu_div_ops =3D { + .disable =3D ccu_div_disable, + .enable =3D ccu_div_enable, + .is_enabled =3D ccu_div_is_enabled, + .get_parent =3D ccu_div_get_parent, + .set_parent =3D ccu_div_set_parent, + .recalc_rate =3D ccu_div_recalc_rate, + .determine_rate =3D clk_hw_determine_rate_no_reparent, +}; + +static unsigned long th1520_pll_vco_recalc_rate(struct clk_hw *hw, + unsigned long parent_rate) +{ + struct ccu_pll *pll =3D hw_to_ccu_pll(hw); + unsigned long div, mul, frac; + unsigned int cfg0, cfg1; + u64 rate =3D parent_rate; + + regmap_read(pll->common.map, pll->common.cfg0, &cfg0); + regmap_read(pll->common.map, pll->common.cfg1, &cfg1); + + mul =3D FIELD_GET(TH1520_PLL_FBDIV, cfg0); + div =3D FIELD_GET(TH1520_PLL_REFDIV, cfg0); + if (!(cfg1 & TH1520_PLL_DSMPD)) { + mul <<=3D TH1520_PLL_FRAC_BITS; + frac =3D FIELD_GET(TH1520_PLL_FRAC, cfg1); + mul +=3D frac; + div <<=3D TH1520_PLL_FRAC_BITS; + } + rate =3D parent_rate * mul; + rate =3D rate / div; + return rate; +} + +static unsigned long th1520_pll_postdiv_recalc_rate(struct clk_hw *hw, + unsigned long parent_rate) +{ + struct ccu_pll *pll =3D hw_to_ccu_pll(hw); + unsigned long div, rate =3D parent_rate; + unsigned int cfg0, cfg1; + + regmap_read(pll->common.map, pll->common.cfg0, &cfg0); + regmap_read(pll->common.map, pll->common.cfg1, &cfg1); + + if (cfg1 & TH1520_PLL_BYPASS) + return rate; + + div =3D FIELD_GET(TH1520_PLL_POSTDIV1, cfg0) * + FIELD_GET(TH1520_PLL_POSTDIV2, cfg0); + + rate =3D rate / div; + + return rate; +} + +static unsigned long ccu_pll_recalc_rate(struct clk_hw *hw, + unsigned long parent_rate) +{ + unsigned long rate =3D parent_rate; + + rate =3D th1520_pll_vco_recalc_rate(hw, rate); + rate =3D th1520_pll_postdiv_recalc_rate(hw, rate); + + return rate; +} + +static const struct clk_ops clk_pll_ops =3D { + .recalc_rate =3D ccu_pll_recalc_rate, +}; + +static const struct clk_parent_data osc_24m_clk[] =3D { + { .index =3D 0 } +}; + +static struct ccu_pll cpu_pll0_clk =3D { + .common =3D { + .clkid =3D CLK_CPU_PLL0, + .cfg0 =3D 0x000, + .cfg1 =3D 0x004, + .hw.init =3D CLK_HW_INIT_PARENTS_DATA("cpu-pll0", + osc_24m_clk, + &clk_pll_ops, + 0), + }, +}; + +static struct ccu_pll cpu_pll1_clk =3D { + .common =3D { + .clkid =3D CLK_CPU_PLL1, + .cfg0 =3D 0x010, + .cfg1 =3D 0x014, + .hw.init =3D CLK_HW_INIT_PARENTS_DATA("cpu-pll1", + osc_24m_clk, + &clk_pll_ops, + 0), + }, +}; + +static struct ccu_pll gmac_pll_clk =3D { + .common =3D { + .clkid =3D CLK_GMAC_PLL, + .cfg0 =3D 0x020, + .cfg1 =3D 0x024, + .hw.init =3D CLK_HW_INIT_PARENTS_DATA("gmac-pll", + osc_24m_clk, + &clk_pll_ops, + 0), + }, +}; + +static const struct clk_hw *gmac_pll_clk_parent[] =3D { + &gmac_pll_clk.common.hw +}; + +static const struct clk_parent_data gmac_pll_clk_pd[] =3D { + { .hw =3D &gmac_pll_clk.common.hw } +}; + +static struct ccu_pll video_pll_clk =3D { + .common =3D { + .clkid =3D CLK_VIDEO_PLL, + .cfg0 =3D 0x030, + .cfg1 =3D 0x034, + .hw.init =3D CLK_HW_INIT_PARENTS_DATA("video-pll", + osc_24m_clk, + &clk_pll_ops, + 0), + }, +}; + +static const struct clk_hw *video_pll_clk_parent[] =3D { + &video_pll_clk.common.hw +}; + +static const struct clk_parent_data video_pll_clk_pd[] =3D { + { .hw =3D &video_pll_clk.common.hw } +}; + +static struct ccu_pll dpu0_pll_clk =3D { + .common =3D { + .clkid =3D CLK_DPU0_PLL, + .cfg0 =3D 0x040, + .cfg1 =3D 0x044, + .hw.init =3D CLK_HW_INIT_PARENTS_DATA("dpu0-pll", + osc_24m_clk, + &clk_pll_ops, + 0), + }, +}; + +static const struct clk_hw *dpu0_pll_clk_parent[] =3D { + &dpu0_pll_clk.common.hw +}; + +static struct ccu_pll dpu1_pll_clk =3D { + .common =3D { + .clkid =3D CLK_DPU1_PLL, + .cfg0 =3D 0x050, + .cfg1 =3D 0x054, + .hw.init =3D CLK_HW_INIT_PARENTS_DATA("dpu1-pll", + osc_24m_clk, + &clk_pll_ops, + 0), + }, +}; + +static const struct clk_hw *dpu1_pll_clk_parent[] =3D { + &dpu1_pll_clk.common.hw +}; + +static struct ccu_pll tee_pll_clk =3D { + .common =3D { + .clkid =3D CLK_TEE_PLL, + .cfg0 =3D 0x060, + .cfg1 =3D 0x064, + .hw.init =3D CLK_HW_INIT_PARENTS_DATA("tee-pll", + osc_24m_clk, + &clk_pll_ops, + 0), + }, +}; + +static const struct clk_parent_data c910_i0_parents[] =3D { + { .hw =3D &cpu_pll0_clk.common.hw }, + { .index =3D 0 } +}; + +struct ccu_mux c910_i0_clk =3D { + .mux =3D TH_CCU_ARG(1, 1), + .common =3D { + .clkid =3D CLK_C910_I0, + .cfg0 =3D 0x100, + .hw.init =3D CLK_HW_INIT_PARENTS_DATA("c910-i0", + c910_i0_parents, + &clk_mux_ops, + 0), + } +}; + +static const struct clk_parent_data c910_parents[] =3D { + { .hw =3D &c910_i0_clk.common.hw }, + { .hw =3D &cpu_pll1_clk.common.hw } +}; + +struct ccu_mux c910_clk =3D { + .mux =3D TH_CCU_ARG(0, 1), + .common =3D { + .clkid =3D CLK_C910, + .cfg0 =3D 0x100, + .hw.init =3D CLK_HW_INIT_PARENTS_DATA("c910", + c910_parents, + &clk_mux_ops, + 0), + } +}; + +static const struct clk_parent_data ahb2_cpusys_parents[] =3D { + { .hw =3D &gmac_pll_clk.common.hw }, + { .index =3D 0 } +}; + +static struct ccu_div ahb2_cpusys_hclk =3D { + .div =3D TH_CCU_DIV_FLAGS(0, 3, CLK_DIVIDER_ONE_BASED), + .mux =3D TH_CCU_ARG(5, 1), + .common =3D { + .clkid =3D CLK_AHB2_CPUSYS_HCLK, + .cfg0 =3D 0x120, + .hw.init =3D CLK_HW_INIT_PARENTS_DATA("ahb2-cpusys-hclk", + ahb2_cpusys_parents, + &ccu_div_ops, + 0), + }, +}; + +static const struct clk_parent_data ahb2_cpusys_hclk_pd[] =3D { + { .hw =3D &ahb2_cpusys_hclk.common.hw } +}; + +static const struct clk_hw *ahb2_cpusys_hclk_parent[] =3D { + &ahb2_cpusys_hclk.common.hw, +}; + +static struct ccu_div apb3_cpusys_pclk =3D { + .div =3D TH_CCU_ARG(0, 3), + .common =3D { + .clkid =3D CLK_APB3_CPUSYS_PCLK, + .cfg0 =3D 0x130, + .hw.init =3D CLK_HW_INIT_PARENTS_HW("apb3-cpusys-pclk", + ahb2_cpusys_hclk_parent, + &ccu_div_ops, + 0), + }, +}; + +static const struct clk_parent_data apb3_cpusys_pclk_pd[] =3D { + { .hw =3D &apb3_cpusys_pclk.common.hw } +}; + +static struct ccu_div axi4_cpusys2_aclk =3D { + .div =3D TH_CCU_DIV_FLAGS(0, 3, CLK_DIVIDER_ONE_BASED), + .common =3D { + .clkid =3D CLK_AXI4_CPUSYS2_ACLK, + .cfg0 =3D 0x134, + .hw.init =3D CLK_HW_INIT_PARENTS_HW("axi4-cpusys2-aclk", + gmac_pll_clk_parent, + &ccu_div_ops, + 0), + }, +}; + +static const struct clk_parent_data axi4_cpusys2_aclk_pd[] =3D { + { .hw =3D &axi4_cpusys2_aclk.common.hw } +}; + +static const struct clk_parent_data axi_parents[] =3D { + { .hw =3D &video_pll_clk.common.hw }, + { .index =3D 0 } +}; + +static struct ccu_div axi_aclk =3D { + .div =3D TH_CCU_DIV_FLAGS(0, 4, CLK_DIVIDER_ONE_BASED), + .mux =3D TH_CCU_ARG(5, 1), + .common =3D { + .clkid =3D CLK_AXI_ACLK, + .cfg0 =3D 0x138, + .hw.init =3D CLK_HW_INIT_PARENTS_DATA("axi-aclk", + axi_parents, + &ccu_div_ops, + 0), + }, +}; + +static const struct clk_parent_data axi_aclk_pd[] =3D { + { .hw =3D &axi_aclk.common.hw } +}; + +static const struct clk_parent_data perisys_ahb_hclk_parents[] =3D { + { .hw =3D &gmac_pll_clk.common.hw }, + { .index =3D 0 }, +}; + +static struct ccu_div perisys_ahb_hclk =3D { + .enable =3D BIT(6), + .div =3D TH_CCU_DIV_FLAGS(0, 4, CLK_DIVIDER_ONE_BASED), + .mux =3D TH_CCU_ARG(5, 1), + .common =3D { + .clkid =3D CLK_PERI_AHB_HCLK, + .cfg0 =3D 0x140, + .hw.init =3D CLK_HW_INIT_PARENTS_DATA("perisys-ahb-hclk", + perisys_ahb_hclk_parents, + &ccu_div_ops, + 0), + }, +}; + +static const struct clk_parent_data perisys_ahb_hclk_pd[] =3D { + { .hw =3D &perisys_ahb_hclk.common.hw } +}; + +static const struct clk_hw *perisys_ahb_hclk_parent[] =3D { + &perisys_ahb_hclk.common.hw +}; + +static struct ccu_div perisys_apb_pclk =3D { + .div =3D TH_CCU_ARG(0, 3), + .common =3D { + .clkid =3D CLK_PERI_APB_PCLK, + .cfg0 =3D 0x150, + .hw.init =3D CLK_HW_INIT_PARENTS_HW("perisys-apb-pclk", + perisys_ahb_hclk_parent, + &ccu_div_ops, + 0), + }, +}; + +static const struct clk_parent_data perisys_apb_pclk_pd[] =3D { + { .hw =3D &perisys_apb_pclk.common.hw } +}; + +static struct ccu_div peri2sys_apb_pclk =3D { + .div =3D TH_CCU_DIV_FLAGS(4, 3, CLK_DIVIDER_ONE_BASED), + .common =3D { + .clkid =3D CLK_PERI2APB_PCLK, + .cfg0 =3D 0x150, + .hw.init =3D CLK_HW_INIT_PARENTS_HW("peri2sys-apb-pclk", + gmac_pll_clk_parent, + &ccu_div_ops, + 0), + }, +}; + +static const struct clk_parent_data peri2sys_apb_pclk_pd[] =3D { + { .hw =3D &peri2sys_apb_pclk.common.hw } +}; + +static CLK_FIXED_FACTOR_FW_NAME(osc12m_clk, "osc_12m", "osc_24m", 2, 1, 0); + +static const char * const out_parents[] =3D { "osc_24m", "osc_12m" }; + +static struct ccu_div out1_clk =3D { + .enable =3D BIT(5), + .div =3D TH_CCU_DIV_FLAGS(0, 3, CLK_DIVIDER_ONE_BASED), + .mux =3D TH_CCU_ARG(4, 1), + .common =3D { + .clkid =3D CLK_OUT1, + .cfg0 =3D 0x1b4, + .hw.init =3D CLK_HW_INIT_PARENTS("out1", + out_parents, + &ccu_div_ops, + 0), + }, +}; + +static struct ccu_div out2_clk =3D { + .enable =3D BIT(5), + .div =3D TH_CCU_DIV_FLAGS(0, 3, CLK_DIVIDER_ONE_BASED), + .mux =3D TH_CCU_ARG(4, 1), + .common =3D { + .clkid =3D CLK_OUT2, + .cfg0 =3D 0x1b8, + .hw.init =3D CLK_HW_INIT_PARENTS("out2", + out_parents, + &ccu_div_ops, + 0), + }, +}; + +static struct ccu_div out3_clk =3D { + .enable =3D BIT(5), + .div =3D TH_CCU_DIV_FLAGS(0, 3, CLK_DIVIDER_ONE_BASED), + .mux =3D TH_CCU_ARG(4, 1), + .common =3D { + .clkid =3D CLK_OUT3, + .cfg0 =3D 0x1bc, + .hw.init =3D CLK_HW_INIT_PARENTS("out3", + out_parents, + &ccu_div_ops, + 0), + }, +}; + +static struct ccu_div out4_clk =3D { + .enable =3D BIT(5), + .div =3D TH_CCU_DIV_FLAGS(0, 3, CLK_DIVIDER_ONE_BASED), + .mux =3D TH_CCU_ARG(4, 1), + .common =3D { + .clkid =3D CLK_OUT4, + .cfg0 =3D 0x1c0, + .hw.init =3D CLK_HW_INIT_PARENTS("out4", + out_parents, + &ccu_div_ops, + 0), + }, +}; + +static const struct clk_parent_data apb_parents[] =3D { + { .hw =3D &gmac_pll_clk.common.hw }, + { .index =3D 0 }, +}; + +static struct ccu_div apb_pclk =3D { + .enable =3D BIT(5), + .div =3D TH_CCU_DIV_FLAGS(0, 4, CLK_DIVIDER_ONE_BASED), + .mux =3D TH_CCU_ARG(7, 1), + .common =3D { + .clkid =3D CLK_APB_PCLK, + .cfg0 =3D 0x1c4, + .hw.init =3D CLK_HW_INIT_PARENTS_DATA("apb-pclk", + apb_parents, + &ccu_div_ops, + 0), + }, +}; + +static const struct clk_hw *npu_parents[] =3D { + &gmac_pll_clk.common.hw, + &video_pll_clk.common.hw +}; + +static struct ccu_div npu_clk =3D { + .enable =3D BIT(4), + .div =3D TH_CCU_DIV_FLAGS(0, 3, CLK_DIVIDER_ONE_BASED), + .mux =3D TH_CCU_ARG(6, 1), + .common =3D { + .clkid =3D CLK_NPU, + .cfg0 =3D 0x1c8, + .hw.init =3D CLK_HW_INIT_PARENTS_HW("npu", + npu_parents, + &ccu_div_ops, + 0), + }, +}; + +static struct ccu_div vi_clk =3D { + .div =3D TH_CCU_DIV_FLAGS(16, 4, CLK_DIVIDER_ONE_BASED), + .common =3D { + .clkid =3D CLK_VI, + .cfg0 =3D 0x1d0, + .hw.init =3D CLK_HW_INIT_PARENTS_HW("vi", + video_pll_clk_parent, + &ccu_div_ops, + 0), + }, +}; + +static struct ccu_div vi_ahb_clk =3D { + .div =3D TH_CCU_DIV_FLAGS(0, 4, CLK_DIVIDER_ONE_BASED), + .common =3D { + .clkid =3D CLK_VI_AHB, + .cfg0 =3D 0x1d0, + .hw.init =3D CLK_HW_INIT_PARENTS_HW("vi-ahb", + video_pll_clk_parent, + &ccu_div_ops, + 0), + }, +}; + +static struct ccu_div vo_axi_clk =3D { + .enable =3D BIT(5), + .div =3D TH_CCU_DIV_FLAGS(0, 4, CLK_DIVIDER_ONE_BASED), + .common =3D { + .clkid =3D CLK_VO_AXI, + .cfg0 =3D 0x1dc, + .hw.init =3D CLK_HW_INIT_PARENTS_HW("vo-axi", + video_pll_clk_parent, + &ccu_div_ops, + 0), + }, +}; + +static struct ccu_div vp_apb_clk =3D { + .div =3D TH_CCU_DIV_FLAGS(0, 3, CLK_DIVIDER_ONE_BASED), + .common =3D { + .clkid =3D CLK_VP_APB, + .cfg0 =3D 0x1e0, + .hw.init =3D CLK_HW_INIT_PARENTS_HW("vp-apb", + gmac_pll_clk_parent, + &ccu_div_ops, + 0), + }, +}; + +static struct ccu_div vp_axi_clk =3D { + .enable =3D BIT(15), + .div =3D TH_CCU_DIV_FLAGS(8, 4, CLK_DIVIDER_ONE_BASED), + .common =3D { + .clkid =3D CLK_VP_AXI, + .cfg0 =3D 0x1e0, + .hw.init =3D CLK_HW_INIT_PARENTS_HW("vp-axi", + video_pll_clk_parent, + &ccu_div_ops, + 0), + }, +}; + +static struct ccu_div venc_clk =3D { + .enable =3D BIT(5), + .div =3D TH_CCU_DIV_FLAGS(0, 3, CLK_DIVIDER_ONE_BASED), + .common =3D { + .clkid =3D CLK_VENC, + .cfg0 =3D 0x1e4, + .hw.init =3D CLK_HW_INIT_PARENTS_HW("venc", + gmac_pll_clk_parent, + &ccu_div_ops, + 0), + }, +}; + +static struct ccu_div dpu0_clk =3D { + .div =3D TH_CCU_DIV_FLAGS(0, 8, CLK_DIVIDER_ONE_BASED), + .common =3D { + .clkid =3D CLK_DPU0, + .cfg0 =3D 0x1e8, + .hw.init =3D CLK_HW_INIT_PARENTS_HW("dpu0", + dpu0_pll_clk_parent, + &ccu_div_ops, + 0), + }, +}; + +static struct ccu_div dpu1_clk =3D { + .div =3D TH_CCU_DIV_FLAGS(0, 8, CLK_DIVIDER_ONE_BASED), + .common =3D { + .clkid =3D CLK_DPU1, + .cfg0 =3D 0x1ec, + .hw.init =3D CLK_HW_INIT_PARENTS_HW("dpu1", + dpu1_pll_clk_parent, + &ccu_div_ops, + 0), + }, +}; + +static CCU_GATE(CLK_BROM, brom_clk, "brom", ahb2_cpusys_hclk_pd, 0x100, BI= T(4), 0); +static CCU_GATE(CLK_BMU, bmu_clk, "bmu", axi4_cpusys2_aclk_pd, 0x100, BIT(= 5), 0); +static CCU_GATE(CLK_AON2CPU_A2X, aon2cpu_a2x_clk, "aon2cpu-a2x", axi4_cpus= ys2_aclk_pd, + 0x134, BIT(8), 0); +static CCU_GATE(CLK_X2X_CPUSYS, x2x_cpusys_clk, "x2x-cpusys", axi4_cpusys2= _aclk_pd, + 0x134, BIT(7), 0); +static CCU_GATE(CLK_CPU2AON_X2H, cpu2aon_x2h_clk, "cpu2aon-x2h", axi_aclk_= pd, 0x138, BIT(8), 0); +static CCU_GATE(CLK_CPU2PERI_X2H, cpu2peri_x2h_clk, "cpu2peri-x2h", axi4_c= pusys2_aclk_pd, + 0x140, BIT(9), 0); +static CCU_GATE(CLK_PERISYS_APB1_HCLK, perisys_apb1_hclk, "perisys-apb1-hc= lk", perisys_ahb_hclk_pd, + 0x150, BIT(9), 0); +static CCU_GATE(CLK_PERISYS_APB2_HCLK, perisys_apb2_hclk, "perisys-apb2-hc= lk", perisys_ahb_hclk_pd, + 0x150, BIT(10), 0); +static CCU_GATE(CLK_PERISYS_APB3_HCLK, perisys_apb3_hclk, "perisys-apb3-hc= lk", perisys_ahb_hclk_pd, + 0x150, BIT(11), 0); +static CCU_GATE(CLK_PERISYS_APB4_HCLK, perisys_apb4_hclk, "perisys-apb4-hc= lk", perisys_ahb_hclk_pd, + 0x150, BIT(12), 0); +static CCU_GATE(CLK_NPU_AXI, npu_axi_clk, "npu-axi", axi_aclk_pd, 0x1c8, B= IT(5), 0); +static CCU_GATE(CLK_CPU2VP, cpu2vp_clk, "cpu2vp", axi_aclk_pd, 0x1e0, BIT(= 13), 0); +static CCU_GATE(CLK_EMMC_SDIO, emmc_sdio_clk, "emmc-sdio", video_pll_clk_p= d, 0x204, BIT(30), 0); +static CCU_GATE(CLK_GMAC1, gmac1_clk, "gmac1", gmac_pll_clk_pd, 0x204, BIT= (26), 0); +static CCU_GATE(CLK_PADCTRL1, padctrl1_clk, "padctrl1", perisys_apb_pclk_p= d, 0x204, BIT(24), 0); +static CCU_GATE(CLK_DSMART, dsmart_clk, "dsmart", perisys_apb_pclk_pd, 0x2= 04, BIT(23), 0); +static CCU_GATE(CLK_PADCTRL0, padctrl0_clk, "padctrl0", perisys_apb_pclk_p= d, 0x204, BIT(22), 0); +static CCU_GATE(CLK_GMAC_AXI, gmac_axi_clk, "gmac-axi", axi4_cpusys2_aclk_= pd, 0x204, BIT(21), 0); +static CCU_GATE(CLK_GPIO3, gpio3_clk, "gpio3-clk", peri2sys_apb_pclk_pd, 0= x204, BIT(20), 0); +static CCU_GATE(CLK_GMAC0, gmac0_clk, "gmac0", gmac_pll_clk_pd, 0x204, BIT= (19), 0); +static CCU_GATE(CLK_PWM, pwm_clk, "pwm", perisys_apb_pclk_pd, 0x204, BIT(1= 8), 0); +static CCU_GATE(CLK_QSPI0, qspi0_clk, "qspi0", video_pll_clk_pd, 0x204, BI= T(17), 0); +static CCU_GATE(CLK_QSPI1, qspi1_clk, "qspi1", video_pll_clk_pd, 0x204, BI= T(16), 0); +static CCU_GATE(CLK_SPI, spi_clk, "spi", video_pll_clk_pd, 0x204, BIT(15),= 0); +static CCU_GATE(CLK_UART0_PCLK, uart0_pclk, "uart0-pclk", perisys_apb_pclk= _pd, 0x204, BIT(14), 0); +static CCU_GATE(CLK_UART1_PCLK, uart1_pclk, "uart1-pclk", perisys_apb_pclk= _pd, 0x204, BIT(13), 0); +static CCU_GATE(CLK_UART2_PCLK, uart2_pclk, "uart2-pclk", perisys_apb_pclk= _pd, 0x204, BIT(12), 0); +static CCU_GATE(CLK_UART3_PCLK, uart3_pclk, "uart3-pclk", perisys_apb_pclk= _pd, 0x204, BIT(11), 0); +static CCU_GATE(CLK_UART4_PCLK, uart4_pclk, "uart4-pclk", perisys_apb_pclk= _pd, 0x204, BIT(10), 0); +static CCU_GATE(CLK_UART5_PCLK, uart5_pclk, "uart5-pclk", perisys_apb_pclk= _pd, 0x204, BIT(9), 0); +static CCU_GATE(CLK_GPIO0, gpio0_clk, "gpio0-clk", perisys_apb_pclk_pd, 0x= 204, BIT(8), 0); +static CCU_GATE(CLK_GPIO1, gpio1_clk, "gpio1-clk", perisys_apb_pclk_pd, 0x= 204, BIT(7), 0); +static CCU_GATE(CLK_GPIO2, gpio2_clk, "gpio2-clk", peri2sys_apb_pclk_pd, 0= x204, BIT(6), 0); +static CCU_GATE(CLK_I2C0, i2c0_clk, "i2c0", perisys_apb_pclk_pd, 0x204, BI= T(5), 0); +static CCU_GATE(CLK_I2C1, i2c1_clk, "i2c1", perisys_apb_pclk_pd, 0x204, BI= T(4), 0); +static CCU_GATE(CLK_I2C2, i2c2_clk, "i2c2", perisys_apb_pclk_pd, 0x204, BI= T(3), 0); +static CCU_GATE(CLK_I2C3, i2c3_clk, "i2c3", perisys_apb_pclk_pd, 0x204, BI= T(2), 0); +static CCU_GATE(CLK_I2C4, i2c4_clk, "i2c4", perisys_apb_pclk_pd, 0x204, BI= T(1), 0); +static CCU_GATE(CLK_I2C5, i2c5_clk, "i2c5", perisys_apb_pclk_pd, 0x204, BI= T(0), 0); +static CCU_GATE(CLK_SPINLOCK, spinlock_clk, "spinlock", ahb2_cpusys_hclk_p= d, 0x208, BIT(10), 0); +static CCU_GATE(CLK_DMA, dma_clk, "dma", axi4_cpusys2_aclk_pd, 0x208, BIT(= 8), 0); +static CCU_GATE(CLK_MBOX0, mbox0_clk, "mbox0", apb3_cpusys_pclk_pd, 0x208,= BIT(7), 0); +static CCU_GATE(CLK_MBOX1, mbox1_clk, "mbox1", apb3_cpusys_pclk_pd, 0x208,= BIT(6), 0); +static CCU_GATE(CLK_MBOX2, mbox2_clk, "mbox2", apb3_cpusys_pclk_pd, 0x208,= BIT(5), 0); +static CCU_GATE(CLK_MBOX3, mbox3_clk, "mbox3", apb3_cpusys_pclk_pd, 0x208,= BIT(4), 0); +static CCU_GATE(CLK_WDT0, wdt0_clk, "wdt0", apb3_cpusys_pclk_pd, 0x208, BI= T(3), 0); +static CCU_GATE(CLK_WDT1, wdt1_clk, "wdt1", apb3_cpusys_pclk_pd, 0x208, BI= T(2), 0); +static CCU_GATE(CLK_TIMER0, timer0_clk, "timer0", apb3_cpusys_pclk_pd, 0x2= 08, BIT(1), 0); +static CCU_GATE(CLK_TIMER1, timer1_clk, "timer1", apb3_cpusys_pclk_pd, 0x2= 08, BIT(0), 0); +static CCU_GATE(CLK_SRAM0, sram0_clk, "sram0", axi_aclk_pd, 0x20c, BIT(4),= 0); +static CCU_GATE(CLK_SRAM1, sram1_clk, "sram1", axi_aclk_pd, 0x20c, BIT(3),= 0); +static CCU_GATE(CLK_SRAM2, sram2_clk, "sram2", axi_aclk_pd, 0x20c, BIT(2),= 0); +static CCU_GATE(CLK_SRAM3, sram3_clk, "sram3", axi_aclk_pd, 0x20c, BIT(1),= 0); + +static CLK_FIXED_FACTOR_HW(gmac_pll_clk_100m, "gmac-pll-clk-100m", + &gmac_pll_clk.common.hw, 10, 1, 0); + +static const struct clk_parent_data uart_sclk_parents[] =3D { + { .hw =3D &gmac_pll_clk_100m.hw }, + { .index =3D 0 }, +}; + +struct ccu_mux uart_sclk =3D { + .mux =3D TH_CCU_ARG(0, 1), + .common =3D { + .clkid =3D CLK_UART_SCLK, + .cfg0 =3D 0x210, + .hw.init =3D CLK_HW_INIT_PARENTS_DATA("uart-sclk", + uart_sclk_parents, + &clk_mux_ops, + 0), + } +}; + +static struct ccu_common *th1520_pll_clks[] =3D { + &cpu_pll0_clk.common, + &cpu_pll1_clk.common, + &gmac_pll_clk.common, + &video_pll_clk.common, + &dpu0_pll_clk.common, + &dpu1_pll_clk.common, + &tee_pll_clk.common, +}; + +static struct ccu_common *th1520_div_clks[] =3D { + &ahb2_cpusys_hclk.common, + &apb3_cpusys_pclk.common, + &axi4_cpusys2_aclk.common, + &perisys_ahb_hclk.common, + &perisys_apb_pclk.common, + &axi_aclk.common, + &peri2sys_apb_pclk.common, + &out1_clk.common, + &out2_clk.common, + &out3_clk.common, + &out4_clk.common, + &apb_pclk.common, + &npu_clk.common, + &vi_clk.common, + &vi_ahb_clk.common, + &vo_axi_clk.common, + &vp_apb_clk.common, + &vp_axi_clk.common, + &cpu2vp_clk.common, + &venc_clk.common, + &dpu0_clk.common, + &dpu1_clk.common, +}; + +static struct ccu_common *th1520_mux_clks[] =3D { + &c910_i0_clk.common, + &c910_clk.common, + &uart_sclk.common, +}; + +static struct ccu_common *th1520_gate_clks[] =3D { + &emmc_sdio_clk.common, + &aon2cpu_a2x_clk.common, + &x2x_cpusys_clk.common, + &brom_clk.common, + &bmu_clk.common, + &cpu2aon_x2h_clk.common, + &cpu2peri_x2h_clk.common, + &perisys_apb1_hclk.common, + &perisys_apb2_hclk.common, + &perisys_apb3_hclk.common, + &perisys_apb4_hclk.common, + &npu_axi_clk.common, + &gmac1_clk.common, + &padctrl1_clk.common, + &dsmart_clk.common, + &padctrl0_clk.common, + &gmac_axi_clk.common, + &gpio3_clk.common, + &gmac0_clk.common, + &pwm_clk.common, + &qspi0_clk.common, + &qspi1_clk.common, + &spi_clk.common, + &uart0_pclk.common, + &uart1_pclk.common, + &uart2_pclk.common, + &uart3_pclk.common, + &uart4_pclk.common, + &uart5_pclk.common, + &gpio0_clk.common, + &gpio1_clk.common, + &gpio2_clk.common, + &i2c0_clk.common, + &i2c1_clk.common, + &i2c2_clk.common, + &i2c3_clk.common, + &i2c4_clk.common, + &i2c5_clk.common, + &spinlock_clk.common, + &dma_clk.common, + &mbox0_clk.common, + &mbox1_clk.common, + &mbox2_clk.common, + &mbox3_clk.common, + &wdt0_clk.common, + &wdt1_clk.common, + &timer0_clk.common, + &timer1_clk.common, + &sram0_clk.common, + &sram1_clk.common, + &sram2_clk.common, + &sram3_clk.common, +}; + +#define NR_CLKS (CLK_UART_SCLK + 1) + +static const struct regmap_config th1520_clk_regmap_config =3D { + .reg_bits =3D 32, + .val_bits =3D 32, + .reg_stride =3D 4, + .fast_io =3D true, +}; + +static int th1520_clk_probe(struct platform_device *pdev) +{ + struct device *dev =3D &pdev->dev; + struct clk_hw_onecell_data *priv; + + struct regmap *map; + void __iomem *base; + struct clk_hw *hw; + int ret, i; + + priv =3D devm_kzalloc(dev, struct_size(priv, hws, NR_CLKS), GFP_KERNEL); + if (!priv) + return -ENOMEM; + + priv->num =3D NR_CLKS; + + base =3D devm_platform_ioremap_resource(pdev, 0); + if (IS_ERR(base)) + return PTR_ERR(base); + + map =3D devm_regmap_init_mmio(dev, base, &th1520_clk_regmap_config); + if (IS_ERR(map)) + return PTR_ERR(map); + + for (i =3D 0; i < ARRAY_SIZE(th1520_pll_clks); i++) { + struct ccu_pll *cp =3D hw_to_ccu_pll(&th1520_pll_clks[i]->hw); + + th1520_pll_clks[i]->map =3D map; + + ret =3D devm_clk_hw_register(dev, &th1520_pll_clks[i]->hw); + if (ret) + return ret; + + priv->hws[cp->common.clkid] =3D &cp->common.hw; + } + + for (i =3D 0; i < ARRAY_SIZE(th1520_div_clks); i++) { + struct ccu_div *cd =3D hw_to_ccu_div(&th1520_div_clks[i]->hw); + + th1520_div_clks[i]->map =3D map; + + ret =3D devm_clk_hw_register(dev, &th1520_div_clks[i]->hw); + if (ret) + return ret; + + priv->hws[cd->common.clkid] =3D &cd->common.hw; + } + + for (i =3D 0; i < ARRAY_SIZE(th1520_mux_clks); i++) { + struct ccu_mux *cm =3D hw_to_ccu_mux(&th1520_mux_clks[i]->hw); + const struct clk_init_data *init =3D cm->common.hw.init; + + th1520_mux_clks[i]->map =3D map; + hw =3D devm_clk_hw_register_mux_parent_data_table(dev, + init->name, + init->parent_data, + init->num_parents, + 0, + base + cm->common.cfg0, + cm->mux.shift, + cm->mux.width, + 0, NULL, NULL); + if (IS_ERR(hw)) + return PTR_ERR(hw); + + priv->hws[cm->common.clkid] =3D hw; + } + + for (i =3D 0; i < ARRAY_SIZE(th1520_gate_clks); i++) { + struct ccu_gate *cg =3D hw_to_ccu_gate(&th1520_gate_clks[i]->hw); + + th1520_gate_clks[i]->map =3D map; + + hw =3D devm_clk_hw_register_gate_parent_data(dev, + cg->common.hw.init->name, + cg->common.hw.init->parent_data, + 0, base + cg->common.cfg0, + ffs(cg->enable) - 1, 0, NULL); + if (IS_ERR(hw)) + return PTR_ERR(hw); + + priv->hws[cg->common.clkid] =3D hw; + } + + ret =3D devm_clk_hw_register(dev, &osc12m_clk.hw); + if (ret) + return ret; + priv->hws[CLK_OSC12M] =3D &osc12m_clk.hw; + + ret =3D devm_clk_hw_register(dev, &gmac_pll_clk_100m.hw); + if (ret) + return ret; + priv->hws[CLK_PLL_GMAC_100M] =3D &gmac_pll_clk_100m.hw; + + ret =3D devm_of_clk_add_hw_provider(dev, of_clk_hw_onecell_get, priv); + if (ret) + return ret; + + return 0; +} + +static const struct of_device_id th1520_clk_match[] =3D { + { + .compatible =3D "thead,th1520-clk-ap", + }, + { /* sentinel */ }, +}; +MODULE_DEVICE_TABLE(of, th1520_clk_match); + +static struct platform_driver th1520_clk_driver =3D { + .probe =3D th1520_clk_probe, + .driver =3D { + .name =3D "th1520-clk", + .of_match_table =3D th1520_clk_match, + }, +}; +module_platform_driver(th1520_clk_driver); + +MODULE_DESCRIPTION("T-HEAD TH1520 AP Clock driver"); +MODULE_AUTHOR("Yangtao Li "); +MODULE_AUTHOR("Jisheng Zhang "); +MODULE_LICENSE("GPL"); --=20 2.34.1 From nobody Tue Dec 16 16:42:07 2025 Received: from mail-ot1-f53.google.com (mail-ot1-f53.google.com [209.85.210.53]) (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 4139516D9AD for ; Thu, 11 Jul 2024 16:56:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720716991; cv=none; b=dMpd5Hj19pcNHPN/P3OE/xHKSogQKbHCbJa3XZRckSYrhSauOg/8kd3K5Kmi7aFZFWWl47HyRbwR/3rQUsaffGqjvS8gTgurjvwNfFfNOlHedBIpbt0iMBRCtt8FWn32gNdqegyKkXslDap5CUevu9JSKSI9RroGuhcvvd/Aw+k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720716991; c=relaxed/simple; bh=sYDrZi/IT7Clln9yQAfkFJd8E3JI+vZ/XaYw2j6k+PM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Vz4Fx4nqvCOqpCkqL1bIxwZBRSuWAos4cRK0aGSHJvgm2bVp6X6B8cm60k343QrJ9QitRWAIoPFsZog1Y32gFlb4XqgEdgaCUDDm+ZXPZ+7nUzojnRVQ3UD5HWBxI6v+I8EYK8rv0yhhRuHVhv5eOW54V9/ITQb8sWXETaz/aLE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=tenstorrent.com; spf=pass smtp.mailfrom=tenstorrent.com; dkim=pass (2048-bit key) header.d=tenstorrent.com header.i=@tenstorrent.com header.b=JEyoZcDQ; arc=none smtp.client-ip=209.85.210.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=tenstorrent.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tenstorrent.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tenstorrent.com header.i=@tenstorrent.com header.b="JEyoZcDQ" Received: by mail-ot1-f53.google.com with SMTP id 46e09a7af769-7035c367c4cso645308a34.2 for ; Thu, 11 Jul 2024 09:56:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tenstorrent.com; s=google; t=1720716989; x=1721321789; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=a3Qnbx+iUmsO5hmeumK/swjsC50+il8elHCmTBS0mBE=; b=JEyoZcDQtLh5U9gYBuLeLbNHWxmrmusYblr40DhqIW7KLL3ONfDVYJ23cbFwcku4j9 yRHkkFGABgzTPxW0DMfY03SiiwcUEJn/NfJtVYQL3vRHNCtGGLb+Gd3IJ90rN7Z9Y2ZP Fh2eimGRT/j4ubZ5RzemiS13mdSRkRQdcDKTBh5MysWXRxBkdhaZepU/x/3/kw87IzIW D4XjJl9v0lu7FtSvw6m5K7sCY2UT3cPnpehsdMlwjhSZCCsxgSiEBMmyoK/p8Lws7tfc IWc6/9J44+bs0iGIF7THkhhlnBhh76Hz3VwyZKwUDaj9WZy9HfiaMn5C0qDP0K7dQ8a/ zU1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720716989; x=1721321789; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=a3Qnbx+iUmsO5hmeumK/swjsC50+il8elHCmTBS0mBE=; b=JE6RT+TpkbtcMCjDGOss+MT26zF9HdZvlTaMTauE3u3Qq8pig0zGJMT3nSumgTR26f 9CmyfeoGmaGm3KJKO7Cy2mN3atdjjlYm/kzepLvqavbnGUtdIdNZY5lSUYIWT8Ua9IL9 eD+KwxKyGCLgKqq+Edwt6jVC/2iIyJlh1OIvi85lUVr74O23TyE+Xm64eqh1HmYT3yIk cb/HV6RgapI/9+qiQd6FnRld0udyL5SJXS6VEh4NszvsAmAw5waLSu5xI7c7h6CbJm/K vZi0stIkyUYXYGOW44GoBtBPPe5SDqlyD+4QavNX7YI2Vo8xLa0his7XvERjsWrt2bkL teFQ== X-Forwarded-Encrypted: i=1; AJvYcCWNsjdG0tUZyN05JqGksTQ+lFmgdQlgFaoCkH+x4cvciK4m02fLsviZjrdnakikCHI5NGXNP+FPB6h9CcWQchEVxKyZoigWOg8tX2AU X-Gm-Message-State: AOJu0YxKNbtNMZYVD74LoRvFaFIT+nbZuDp56stucnXnCHvFaAiUrj9p n2I3veAr8h+S3adXVBTNG/fOsxe9aJSFhTvQsQ55K4qp4sRFweWerilY0wkeqCQ= X-Google-Smtp-Source: AGHT+IFT11cDKx1ITw8GMjOL9UGcw5whIW+QoK906Roo3HeBs1RdbW9Be5+V9SHoXTtfetGFJkarfA== X-Received: by 2002:a05:6830:10cc:b0:704:4b6f:ac87 with SMTP id 46e09a7af769-7044b6fad6amr5865662a34.17.1720716989421; Thu, 11 Jul 2024 09:56:29 -0700 (PDT) Received: from [127.0.1.1] ([2601:1c2:1802:170:5ee9:fea0:d9de:cee8]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-787089bc5f6sm1360038a12.92.2024.07.11.09.56.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Jul 2024 09:56:29 -0700 (PDT) From: Drew Fustini Date: Thu, 11 Jul 2024 09:56:21 -0700 Subject: [PATCH v3 3/7] riscv: dts: thead: Add TH1520 AP_SUBSYS clock controller Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20240711-th1520-clk-v3-3-6ff17bb318fb@tenstorrent.com> References: <20240711-th1520-clk-v3-0-6ff17bb318fb@tenstorrent.com> In-Reply-To: <20240711-th1520-clk-v3-0-6ff17bb318fb@tenstorrent.com> To: Jisheng Zhang , Guo Ren , Fu Wei , Yangtao Li , Thomas Bonnefille , Emil Renner Berthing , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Paul Walmsley , Palmer Dabbelt , Albert Ou Cc: linux-riscv@lists.infradead.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Drew Fustini X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1720716985; l=1213; i=dfustini@tenstorrent.com; s=20230430; h=from:subject:message-id; bh=sYDrZi/IT7Clln9yQAfkFJd8E3JI+vZ/XaYw2j6k+PM=; b=wUrrFs5q2J1pzVgeXUmh4OazEalf5YR5o4KRGJccYDi2MKdzK9ga2hXoA5XTCRa+cFkuSufnJ 8urCX2niya3A1uefhZS985sJ9D73ukNMDwmyPRrI5M1Eacls5UR+wTd X-Developer-Key: i=dfustini@tenstorrent.com; a=ed25519; pk=p3GKE9XFmjhwAayAHG4U108yag7V8xQVd4zJLdW0g7g= Add node for the AP_SUBSYS clock controller on the T-Head TH1520 SoC. Link: https://openbeagle.org/beaglev-ahead/beaglev-ahead/-/blob/main/docs/T= H1520%20System%20User%20Manual.pdf Link: https://git.beagleboard.org/beaglev-ahead/beaglev-ahead/-/tree/main/d= ocs Signed-off-by: Drew Fustini --- arch/riscv/boot/dts/thead/th1520.dtsi | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/arch/riscv/boot/dts/thead/th1520.dtsi b/arch/riscv/boot/dts/th= ead/th1520.dtsi index d2fa25839012..10a38ed55658 100644 --- a/arch/riscv/boot/dts/thead/th1520.dtsi +++ b/arch/riscv/boot/dts/thead/th1520.dtsi @@ -5,6 +5,7 @@ */ =20 #include +#include =20 / { compatible =3D "thead,th1520"; @@ -161,6 +162,13 @@ soc { dma-noncoherent; ranges; =20 + clk: clock-controller@ffef010000 { + compatible =3D "thead,th1520-clk-ap"; + reg =3D <0xff 0xef010000 0x0 0x1000>; + clocks =3D <&osc>; + #clock-cells =3D <1>; + }; + plic: interrupt-controller@ffd8000000 { compatible =3D "thead,th1520-plic", "thead,c900-plic"; reg =3D <0xff 0xd8000000 0x0 0x01000000>; --=20 2.34.1 From nobody Tue Dec 16 16:42:07 2025 Received: from mail-oo1-f47.google.com (mail-oo1-f47.google.com [209.85.161.47]) (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 2419B16DC36 for ; Thu, 11 Jul 2024 16:56:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720716992; cv=none; b=XyQ55oPhvALP2c/yC2GNGU4ljPZS0GbeCpKJV5mZIp8c8RBlOIS/cWAGcpfxJpJs+R4vfb9vtEyEtJXZ8j7AZgweKDBgn+zb0zQFLh5msR1uYidDav666fapfRKXSj605es2/Oj+mslF8A5y1ZaxqwK2xmCL46DTqYzS9v4iM/Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720716992; c=relaxed/simple; bh=xJjYh93ZJoHUv/WIA9Svqg5tFxria/k9YnyGDGG2DQA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=jPxbW7g6cc1+aaWrB3lzbydfuOkuiXwcUNUwrg2+m8HEMd5EvrLo6V3R6NmL0Gmq4hi2cnrAzTw8i/0aUdMPLmh1rdLvvpzS14AS494Kh8Rip7Wh2jzgR3AjwksdgBc17VenaYh4QdGBnmbDJTXOPGlWOrMhOnlj0HFDWKGudxU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=tenstorrent.com; spf=pass smtp.mailfrom=tenstorrent.com; dkim=pass (2048-bit key) header.d=tenstorrent.com header.i=@tenstorrent.com header.b=XW6NlZXL; arc=none smtp.client-ip=209.85.161.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=tenstorrent.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tenstorrent.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tenstorrent.com header.i=@tenstorrent.com header.b="XW6NlZXL" Received: by mail-oo1-f47.google.com with SMTP id 006d021491bc7-5c47c41eb84so632056eaf.0 for ; Thu, 11 Jul 2024 09:56:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tenstorrent.com; s=google; t=1720716990; x=1721321790; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=ruH/DofYGilJLJutg03AKQ4VFq4us3a7+DtTMhD3iuU=; b=XW6NlZXLQssLxT+cs2CdC/XCf6vgn4YqvqQqmU8HKwh+H3d7QFxWkpL7uCXnHfbMOW z7B1vR5u+vB/rTZqP1ScemCDrR9BVhsti8FJgFDGI6oftz22/LXIY2rFPv2Gzk3EGDFo 1/0ZPYziRBbgW+4wx093/bmsAivU2+WCnyvPbUa0rHTYfh/76zpTGGI0Ij1z+1eGl2IK qQRXKaPsrHM9vFlzx1ONoiYEflwiyIqe8wJoUd9DzlaDJOChbsvuIPIqE1rNf1IFgeFs rJMuc3UYFO7xDU6UKNQ96n2ebtxsft+8NFSvTy0gXZvkG7HqBmuV+EVPw/usKQuSXAbb lUlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720716990; x=1721321790; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ruH/DofYGilJLJutg03AKQ4VFq4us3a7+DtTMhD3iuU=; b=rDdvUx7A50b/raCgerIdbo5eDlmTrt330nQoWBopYjZiQpfkOKwmUsP5fg7L3siMLw puDiC6lhAd/arRzwaUBGOtvFLIePTwr88kVoKK6yTXkVRCDH9csq7Jd2ofG8e9bgX4gY nKQF6kn0Uay/W3I+SWWKGG4vac1pS5sexIHldNtvHJCUXc3IMQZ5xf78+zerxH307K51 F9pixTdNRRUy85+6/JNmSNRQ0Mqxi6Pp5ZgPvUN1qlByAvfhP8ptueeY35oPuFMdzox/ zMQh4l+1qWJluqIhlnDX2j62RywFMdI5tnCJpr1SdSexEg/uKYDkJR9J8yvOje4GilnU 1Opg== X-Forwarded-Encrypted: i=1; AJvYcCUzQ2lKtpSw8rZ0N6bfHbYqfWRlDlXpOubAVRUqejEjqQsFGsNQfqeaEqJWHrgRGqtYpq8wAFvpynHA/Crl0MTNq4mpKVtNMF+v8KG6 X-Gm-Message-State: AOJu0YwLqx1SkILtgEdBzK5GP8tKyA8D4x+H4hFgZ+c6PHQm5j5WB4iO /BS+6GU7E91FLmAcq+pDEFg6FHmYPLaNQ+3uy/vm1vm+cVNo8ev3tsNJDWwtTA4= X-Google-Smtp-Source: AGHT+IHoMUzquKnbfcRkWdDziuw20/JinIdYFvXU3N+Paif2hr1KelFCJVVI2IsdFLb2Re6eGOslMg== X-Received: by 2002:a05:6870:7009:b0:255:2e14:3d9d with SMTP id 586e51a60fabf-25eae75ee3bmr7502793fac.5.1720716990273; Thu, 11 Jul 2024 09:56:30 -0700 (PDT) Received: from [127.0.1.1] ([2601:1c2:1802:170:5ee9:fea0:d9de:cee8]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-787089bc5f6sm1360038a12.92.2024.07.11.09.56.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Jul 2024 09:56:30 -0700 (PDT) From: Drew Fustini Date: Thu, 11 Jul 2024 09:56:22 -0700 Subject: [PATCH v3 4/7] riscv: dts: thead: change TH1520 uart nodes to use clock controller Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20240711-th1520-clk-v3-4-6ff17bb318fb@tenstorrent.com> References: <20240711-th1520-clk-v3-0-6ff17bb318fb@tenstorrent.com> In-Reply-To: <20240711-th1520-clk-v3-0-6ff17bb318fb@tenstorrent.com> To: Jisheng Zhang , Guo Ren , Fu Wei , Yangtao Li , Thomas Bonnefille , Emil Renner Berthing , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Paul Walmsley , Palmer Dabbelt , Albert Ou Cc: linux-riscv@lists.infradead.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Drew Fustini X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1720716985; l=4190; i=dfustini@tenstorrent.com; s=20230430; h=from:subject:message-id; bh=xJjYh93ZJoHUv/WIA9Svqg5tFxria/k9YnyGDGG2DQA=; b=nyFV0Wu2uJFoC+agpP9/18eNNSyUfRdKDDjw2JpZxahuHrsrQHpiFKlqu7sAk8ktKhyV+SL31 LzXurV9LWtECyLMExgBgAcJCRhCeFzHR3oEB+1ljjMvM7eh1LJWa4rX X-Developer-Key: i=dfustini@tenstorrent.com; a=ed25519; pk=p3GKE9XFmjhwAayAHG4U108yag7V8xQVd4zJLdW0g7g= Change the clock property in TH1520 uart nodes to a clock provided by AP_SUBSYS clock controller. Link: https://git.beagleboard.org/beaglev-ahead/beaglev-ahead/-/tree/main/d= ocs Signed-off-by: Drew Fustini --- arch/riscv/boot/dts/thead/th1520-beaglev-ahead.dts | 4 ---- .../boot/dts/thead/th1520-lichee-module-4a.dtsi | 4 ---- arch/riscv/boot/dts/thead/th1520.dtsi | 24 +++++++++++-------= ---- 3 files changed, 12 insertions(+), 20 deletions(-) diff --git a/arch/riscv/boot/dts/thead/th1520-beaglev-ahead.dts b/arch/risc= v/boot/dts/thead/th1520-beaglev-ahead.dts index d9b4de9e4757..164afd18b56c 100644 --- a/arch/riscv/boot/dts/thead/th1520-beaglev-ahead.dts +++ b/arch/riscv/boot/dts/thead/th1520-beaglev-ahead.dts @@ -52,10 +52,6 @@ &sdhci_clk { clock-frequency =3D <198000000>; }; =20 -&uart_sclk { - clock-frequency =3D <100000000>; -}; - &dmac0 { status =3D "okay"; }; diff --git a/arch/riscv/boot/dts/thead/th1520-lichee-module-4a.dtsi b/arch/= riscv/boot/dts/thead/th1520-lichee-module-4a.dtsi index 1365d3a512a3..1b7ede570994 100644 --- a/arch/riscv/boot/dts/thead/th1520-lichee-module-4a.dtsi +++ b/arch/riscv/boot/dts/thead/th1520-lichee-module-4a.dtsi @@ -33,10 +33,6 @@ &sdhci_clk { clock-frequency =3D <198000000>; }; =20 -&uart_sclk { - clock-frequency =3D <100000000>; -}; - &dmac0 { status =3D "okay"; }; diff --git a/arch/riscv/boot/dts/thead/th1520.dtsi b/arch/riscv/boot/dts/th= ead/th1520.dtsi index 10a38ed55658..66df04ceb3e4 100644 --- a/arch/riscv/boot/dts/thead/th1520.dtsi +++ b/arch/riscv/boot/dts/thead/th1520.dtsi @@ -141,12 +141,6 @@ apb_clk: apb-clk-clock { #clock-cells =3D <0>; }; =20 - uart_sclk: uart-sclk-clock { - compatible =3D "fixed-clock"; - clock-output-names =3D "uart_sclk"; - #clock-cells =3D <0>; - }; - sdhci_clk: sdhci-clock { compatible =3D "fixed-clock"; clock-frequency =3D <198000000>; @@ -195,7 +189,8 @@ uart0: serial@ffe7014000 { compatible =3D "snps,dw-apb-uart"; reg =3D <0xff 0xe7014000 0x0 0x100>; interrupts =3D <36 IRQ_TYPE_LEVEL_HIGH>; - clocks =3D <&uart_sclk>; + clocks =3D <&clk CLK_UART_SCLK>, <&clk CLK_UART0_PCLK>; + clock-names =3D "baudclk", "apb_pclk"; reg-shift =3D <2>; reg-io-width =3D <4>; status =3D "disabled"; @@ -232,7 +227,8 @@ uart1: serial@ffe7f00000 { compatible =3D "snps,dw-apb-uart"; reg =3D <0xff 0xe7f00000 0x0 0x100>; interrupts =3D <37 IRQ_TYPE_LEVEL_HIGH>; - clocks =3D <&uart_sclk>; + clocks =3D <&clk CLK_UART_SCLK>, <&clk CLK_UART1_PCLK>; + clock-names =3D "baudclk", "apb_pclk"; reg-shift =3D <2>; reg-io-width =3D <4>; status =3D "disabled"; @@ -242,7 +238,8 @@ uart3: serial@ffe7f04000 { compatible =3D "snps,dw-apb-uart"; reg =3D <0xff 0xe7f04000 0x0 0x100>; interrupts =3D <39 IRQ_TYPE_LEVEL_HIGH>; - clocks =3D <&uart_sclk>; + clocks =3D <&clk CLK_UART_SCLK>, <&clk CLK_UART3_PCLK>; + clock-names =3D "baudclk", "apb_pclk"; reg-shift =3D <2>; reg-io-width =3D <4>; status =3D "disabled"; @@ -324,7 +321,8 @@ uart2: serial@ffec010000 { compatible =3D "snps,dw-apb-uart"; reg =3D <0xff 0xec010000 0x0 0x4000>; interrupts =3D <38 IRQ_TYPE_LEVEL_HIGH>; - clocks =3D <&uart_sclk>; + clocks =3D <&clk CLK_UART_SCLK>, <&clk CLK_UART2_PCLK>; + clock-names =3D "baudclk", "apb_pclk"; reg-shift =3D <2>; reg-io-width =3D <4>; status =3D "disabled"; @@ -386,7 +384,8 @@ uart4: serial@fff7f08000 { compatible =3D "snps,dw-apb-uart"; reg =3D <0xff 0xf7f08000 0x0 0x4000>; interrupts =3D <40 IRQ_TYPE_LEVEL_HIGH>; - clocks =3D <&uart_sclk>; + clocks =3D <&clk CLK_UART_SCLK>, <&clk CLK_UART4_PCLK>; + clock-names =3D "baudclk", "apb_pclk"; reg-shift =3D <2>; reg-io-width =3D <4>; status =3D "disabled"; @@ -396,7 +395,8 @@ uart5: serial@fff7f0c000 { compatible =3D "snps,dw-apb-uart"; reg =3D <0xff 0xf7f0c000 0x0 0x4000>; interrupts =3D <41 IRQ_TYPE_LEVEL_HIGH>; - clocks =3D <&uart_sclk>; + clocks =3D <&clk CLK_UART_SCLK>, <&clk CLK_UART5_PCLK>; + clock-names =3D "baudclk", "apb_pclk"; reg-shift =3D <2>; reg-io-width =3D <4>; status =3D "disabled"; --=20 2.34.1 From nobody Tue Dec 16 16:42:07 2025 Received: from mail-il1-f170.google.com (mail-il1-f170.google.com [209.85.166.170]) (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 94AFD16EB42 for ; Thu, 11 Jul 2024 16:56:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720716997; cv=none; b=nI5U/FykZuIVc9bqJOoYC6IqAERYUmrYyu2Q7yl71/03NswSidqOkfu0lRFjjBR7s8WWhWUS4kFsLM2au7jCwQ6khKazgoyc9rHfL4AM6wQw5kTgH+kQ9QcIF5me1ATXJ/EtnV6gSqXqXWecJZ7yo9ldd9hBmr8SKQFhxCpcj2o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720716997; c=relaxed/simple; bh=tRjLHNA3SUuyjwpgTudoab8pZI9wG5YkzGm3OgGpM00=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=bZ4q4PfTAuwiPAzvxyziSZ/4dqYd3k9c7DlFhiF8u2An0PXRiyX150OIiyZTboFNmqZCUkPWsK5uCQsQ83wpsVsC5f1Ugeocxe1Bs8ALBnKMLV5qGgPMOIIhEDkPvu6MmVkp8/4YNhBNyP0cFsV0L2BHLIvYZ4s68+3OriPthLM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=tenstorrent.com; spf=pass smtp.mailfrom=tenstorrent.com; dkim=pass (2048-bit key) header.d=tenstorrent.com header.i=@tenstorrent.com header.b=WM3vqhHK; arc=none smtp.client-ip=209.85.166.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=tenstorrent.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tenstorrent.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tenstorrent.com header.i=@tenstorrent.com header.b="WM3vqhHK" Received: by mail-il1-f170.google.com with SMTP id e9e14a558f8ab-3738690172eso4147535ab.1 for ; Thu, 11 Jul 2024 09:56:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tenstorrent.com; s=google; t=1720716995; x=1721321795; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=te6oCpGS/6VZhMCuPEflrqjqzTzldtZxzFsSrDrIRSM=; b=WM3vqhHKHHzLTfrUpFRYflHQ+fRw7rXGRY/SdRFvqgkgrcE6hhAmeROmQtlvQ4QmVU RgZx2/DtVLwOGxoFNoLYCxwPE7gKWwUJOxnvQEaHwYeoQdyzvuxv3hLUyyUcDDELd9lo Q1ojke64PaITxvEdc8xq4Z5IX7YW0B3eRBqgLW5vxxzP7KDLMnc0EBk2Qcsq3iSRonJ1 z4i3jqNWkKM2SdLjsVTAbSkm4325r1y7Hr3zRpUoJAj3wBlR8Q8n8mE8LiwRxC9nuKI+ 7n9YyJNSXxMArgCcyW44snDuUeMqGiqslwDdG1CgsvT4hu6bdch3xt+fo351Dj5S+PZb 9i3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720716995; x=1721321795; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=te6oCpGS/6VZhMCuPEflrqjqzTzldtZxzFsSrDrIRSM=; b=c/rHZhgN0TdggdmEbnpEOV9seG2j67I/C0+fy/fO9cRPTqxu4gfZQyMNbVy2g4ecdd mpT19RG7fArvjvjCY3XnJoPer6gDaZj91kuqUp26ePVhZzAAv4qsSYjktx6GCi6AgkAT JvRokYZhq3PmhcZmp51IIJ3h0KpNbCMZQCR5ia9bleE1w0LZWqCNqj7cTbRyzJ+LpcPq YtZ3v+ZNRdNVEyeuqRYYDg1D1YhBcUrXRWR8AXNUI02GTb4Fi9zf6QHPHEN3HkRdU5PZ Eh2ik6njSaEEvzXgSCnpgoFZYf3ryVvqtE4bodXrs0aahkuskVolsHr4jXQgmimd0rAy EPsw== X-Forwarded-Encrypted: i=1; AJvYcCVJeQVVd1CVnRv2vHaGOSvf1MI5oFZAFifWT6UeNAml1NQmS9Nnk8n9vEAu/elYyAh4vZEUVQMhOi4a8SG0FzBkzOGmguJWweAMfYy5 X-Gm-Message-State: AOJu0YyYzpsAm9cX/TlTm6lpsGpeoID8hensOM0kMo4prOTFgwe5snJV AFnURcm2maSJYOCzVkROYFFCWgnYgu84+m9nh8u8mw+2ZJiAJ60a0ZVImaVzQHQ= X-Google-Smtp-Source: AGHT+IGzWPfDV/E3YcTV0DYpsGumkkg2HKME8gswI8MuO7enICuTRWBiTCWgxl87cgh3yZKPyv10Pw== X-Received: by 2002:a05:6e02:1aa3:b0:374:a781:64b9 with SMTP id e9e14a558f8ab-38a581a844cmr111474085ab.13.1720716991215; Thu, 11 Jul 2024 09:56:31 -0700 (PDT) Received: from [127.0.1.1] ([2601:1c2:1802:170:5ee9:fea0:d9de:cee8]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-787089bc5f6sm1360038a12.92.2024.07.11.09.56.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Jul 2024 09:56:30 -0700 (PDT) From: Drew Fustini Date: Thu, 11 Jul 2024 09:56:23 -0700 Subject: [PATCH v3 5/7] riscv: dts: thead: change TH1520 mmc nodes to use clock controller Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20240711-th1520-clk-v3-5-6ff17bb318fb@tenstorrent.com> References: <20240711-th1520-clk-v3-0-6ff17bb318fb@tenstorrent.com> In-Reply-To: <20240711-th1520-clk-v3-0-6ff17bb318fb@tenstorrent.com> To: Jisheng Zhang , Guo Ren , Fu Wei , Yangtao Li , Thomas Bonnefille , Emil Renner Berthing , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Paul Walmsley , Palmer Dabbelt , Albert Ou Cc: linux-riscv@lists.infradead.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Drew Fustini X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1720716985; l=2932; i=dfustini@tenstorrent.com; s=20230430; h=from:subject:message-id; bh=tRjLHNA3SUuyjwpgTudoab8pZI9wG5YkzGm3OgGpM00=; b=/J1Le/i2Ub7P3mFRDRhdpUD8z6RNIFe8SaZHadbyBrIr8iwcVW+MMA9ZwLU7NYkZQFxaufvA3 4rYWM5YCrJ5AjZXjifm3Pum7SMOQhZ0ySfNAxPh953GcvtVzQG1jmgo X-Developer-Key: i=dfustini@tenstorrent.com; a=ed25519; pk=p3GKE9XFmjhwAayAHG4U108yag7V8xQVd4zJLdW0g7g= Change the clock property in the TH1520 mmc controller nodes to a clock provided by AP_SYS clock controller. Remove sdhci fixed clock reference from BeagleV Ahead and LPI4a dts. Link: https://git.beagleboard.org/beaglev-ahead/beaglev-ahead/-/tree/main/d= ocs Signed-off-by: Drew Fustini --- arch/riscv/boot/dts/thead/th1520-beaglev-ahead.dts | 4 ---- arch/riscv/boot/dts/thead/th1520-lichee-module-4a.dtsi | 4 ---- arch/riscv/boot/dts/thead/th1520.dtsi | 13 +++---------- 3 files changed, 3 insertions(+), 18 deletions(-) diff --git a/arch/riscv/boot/dts/thead/th1520-beaglev-ahead.dts b/arch/risc= v/boot/dts/thead/th1520-beaglev-ahead.dts index 164afd18b56c..55f1ed0cb433 100644 --- a/arch/riscv/boot/dts/thead/th1520-beaglev-ahead.dts +++ b/arch/riscv/boot/dts/thead/th1520-beaglev-ahead.dts @@ -48,10 +48,6 @@ &apb_clk { clock-frequency =3D <62500000>; }; =20 -&sdhci_clk { - clock-frequency =3D <198000000>; -}; - &dmac0 { status =3D "okay"; }; diff --git a/arch/riscv/boot/dts/thead/th1520-lichee-module-4a.dtsi b/arch/= riscv/boot/dts/thead/th1520-lichee-module-4a.dtsi index 1b7ede570994..762eceb415f8 100644 --- a/arch/riscv/boot/dts/thead/th1520-lichee-module-4a.dtsi +++ b/arch/riscv/boot/dts/thead/th1520-lichee-module-4a.dtsi @@ -29,10 +29,6 @@ &apb_clk { clock-frequency =3D <62500000>; }; =20 -&sdhci_clk { - clock-frequency =3D <198000000>; -}; - &dmac0 { status =3D "okay"; }; diff --git a/arch/riscv/boot/dts/thead/th1520.dtsi b/arch/riscv/boot/dts/th= ead/th1520.dtsi index 66df04ceb3e4..ce3a0847aa9c 100644 --- a/arch/riscv/boot/dts/thead/th1520.dtsi +++ b/arch/riscv/boot/dts/thead/th1520.dtsi @@ -141,13 +141,6 @@ apb_clk: apb-clk-clock { #clock-cells =3D <0>; }; =20 - sdhci_clk: sdhci-clock { - compatible =3D "fixed-clock"; - clock-frequency =3D <198000000>; - clock-output-names =3D "sdhci_clk"; - #clock-cells =3D <0>; - }; - soc { compatible =3D "simple-bus"; interrupt-parent =3D <&plic>; @@ -200,7 +193,7 @@ emmc: mmc@ffe7080000 { compatible =3D "thead,th1520-dwcmshc"; reg =3D <0xff 0xe7080000 0x0 0x10000>; interrupts =3D <62 IRQ_TYPE_LEVEL_HIGH>; - clocks =3D <&sdhci_clk>; + clocks =3D <&clk CLK_EMMC_SDIO>; clock-names =3D "core"; status =3D "disabled"; }; @@ -209,7 +202,7 @@ sdio0: mmc@ffe7090000 { compatible =3D "thead,th1520-dwcmshc"; reg =3D <0xff 0xe7090000 0x0 0x10000>; interrupts =3D <64 IRQ_TYPE_LEVEL_HIGH>; - clocks =3D <&sdhci_clk>; + clocks =3D <&clk CLK_EMMC_SDIO>; clock-names =3D "core"; status =3D "disabled"; }; @@ -218,7 +211,7 @@ sdio1: mmc@ffe70a0000 { compatible =3D "thead,th1520-dwcmshc"; reg =3D <0xff 0xe70a0000 0x0 0x10000>; interrupts =3D <71 IRQ_TYPE_LEVEL_HIGH>; - clocks =3D <&sdhci_clk>; + clocks =3D <&clk CLK_EMMC_SDIO>; clock-names =3D "core"; status =3D "disabled"; }; --=20 2.34.1 From nobody Tue Dec 16 16:42:07 2025 Received: from mail-ot1-f50.google.com (mail-ot1-f50.google.com [209.85.210.50]) (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 A7CBC16EB55 for ; Thu, 11 Jul 2024 16:56:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720716998; cv=none; b=Gl2MYmpLlSiBZpLkP1Vr20VWsY1TQx5R3iRyo4WTK4p9+cW9oj8P4TkkRabx+T0Zn6lGHiM+hFqQxiYwNVAncR26r9AUMr5QhBR3wpUr2AunmIucH7ZTN5cY3H51eBC0iqnmrZ63GtvehCowt6793r8Yl23nKcrMXD7xzrRh4IA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720716998; c=relaxed/simple; bh=SbrKbjP9HrE9knhFbrY+EYErtsxWNVunfI1xMyBiezU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=F+V7/ZGBFWB0nBhfgHEm3zqWEkeX09e2wsF2zLAeLqBK1IlI2MIwFlBOOM7y8dRITwGUlHRnHzF16ZytQzcKxKabCqtEqNUcQ+TmbO6RUM8wNI1zMxlHspUHsp/gldEu/G2G2nDEYZMq2G5Rhd7eDY7jvvoz2zhUFWaWS5HkM/0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=tenstorrent.com; spf=pass smtp.mailfrom=tenstorrent.com; dkim=pass (2048-bit key) header.d=tenstorrent.com header.i=@tenstorrent.com header.b=ckve2K7m; arc=none smtp.client-ip=209.85.210.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=tenstorrent.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tenstorrent.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tenstorrent.com header.i=@tenstorrent.com header.b="ckve2K7m" Received: by mail-ot1-f50.google.com with SMTP id 46e09a7af769-704473c0698so542018a34.3 for ; Thu, 11 Jul 2024 09:56:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tenstorrent.com; s=google; t=1720716996; x=1721321796; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=xP2OaE3Tmwgvn0E4Ola04pPSwphXRoqY7WXxjCPr0EA=; b=ckve2K7mbwTK/Xvtywlung2L53JWOvVr3J3Gja9FiV+KEs/N39rlC/lqY6qMyg70lx nsPR4Tqs2CBVh10KE+ylJG1OkMsHYnD3cwtvZkCB0pQx6SpdIFuAzfI5qH2dp22ikPBt 5W2QZryKu3kWdn2aDPHTSdFQgcfCvjHA8D/pmXyM5r1DorunYuRh59B9nQRHipWSlggM 5XtTmfLzAbTAbqgLK8XCeSIA1Rc1Z62koWMm3qsBBclN+6U352wQdawBywmMjtnloqeS /3uPE3vosgka6EUIAHp1SXd8fBBUdGyABGygYqrlNNSC+m71spw1k39rK8Qg4R3vDnAx aZhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720716996; x=1721321796; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xP2OaE3Tmwgvn0E4Ola04pPSwphXRoqY7WXxjCPr0EA=; b=f6IDSUrRhEIF6FP9MQ3nRg3MQQsGK/T5m9jAbmZy0lGop6xmu7HbBDuAVP5dE5YFgF XBpqPKQusfGdlON5QVbbALxE907EslLE+cNTnx3RDJ3NAdOBGPE8qrUr2wqsrNRsWjcv q2jijRzZ8l6wqzzVj5uT83c4NVOxjS+/8wVKQyLhHLHKYCZZ639EROyrsMvv5u3IulAI 7by0HPNGdPxtsPyz6lf4MCfCJZmZo+RGDtePPx46s4Vkw9pQBBfkM/GrNvsSRRFF+UeP 4lAFVM4MZno9fvNjFBGCTGeDrNwg3zmMkkSxQ+SYBe2X08X/PAWpWl14HG3dnP14tcWz eAIw== X-Forwarded-Encrypted: i=1; AJvYcCXEFJpZ+hS9vz98PMYksLy73fyCd9np2QmAIvkynashMzlU6INObRxXDtZ4Y6j0saTGpzaQnoj+gvx3ep87UEgpr6OdU8fK+eCjD3iV X-Gm-Message-State: AOJu0Yy+zjSJf5swvQCAYNwYsu0OWTmWQqsI97oGbs/71HWFrg5VylVj YIvG7vhO+UshylShqhMWMFBCXbVIFdIENF0vxffUi5qT65mzNYQelagct1IbqFo= X-Google-Smtp-Source: AGHT+IFpjkCHBHOqJ28iyDK9YRSjs6qFqsZuEPtegvqPUiJkgrWahk2gMval4RPQxaSagii6iKO6gQ== X-Received: by 2002:a05:6359:b93:b0:1a4:1351:9c9c with SMTP id e5c5f4694b2df-1aade1271camr695279455d.29.1720716995711; Thu, 11 Jul 2024 09:56:35 -0700 (PDT) Received: from [127.0.1.1] ([2601:1c2:1802:170:5ee9:fea0:d9de:cee8]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-787089bc5f6sm1360038a12.92.2024.07.11.09.56.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Jul 2024 09:56:35 -0700 (PDT) From: Drew Fustini Date: Thu, 11 Jul 2024 09:56:24 -0700 Subject: [PATCH v3 6/7] riscv: dts: thead: update TH1520 dma and timer nodes to use clock controller Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20240711-th1520-clk-v3-6-6ff17bb318fb@tenstorrent.com> References: <20240711-th1520-clk-v3-0-6ff17bb318fb@tenstorrent.com> In-Reply-To: <20240711-th1520-clk-v3-0-6ff17bb318fb@tenstorrent.com> To: Jisheng Zhang , Guo Ren , Fu Wei , Yangtao Li , Thomas Bonnefille , Emil Renner Berthing , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Paul Walmsley , Palmer Dabbelt , Albert Ou Cc: linux-riscv@lists.infradead.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Drew Fustini X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1720716985; l=4931; i=dfustini@tenstorrent.com; s=20230430; h=from:subject:message-id; bh=SbrKbjP9HrE9knhFbrY+EYErtsxWNVunfI1xMyBiezU=; b=WDiLeijUC5umVxfBGXR8J6mW5IaQwccj+b6cXnR4L6231y11sre+HIcgSdKtTfvk8kgao1XQ9 y/Bzm08N9tfCpF+3+z6JAXh8vLKuANz2ymtNrfobAeO5J0C9YkBDhd1 X-Developer-Key: i=dfustini@tenstorrent.com; a=ed25519; pk=p3GKE9XFmjhwAayAHG4U108yag7V8xQVd4zJLdW0g7g= Change the dma-controller and timer nodes to use the APB clock provided by the AP_SUBSYS clock controller. Remove apb_clk reference from BeagleV Ahead and LPI4a dts. Link: https://git.beagleboard.org/beaglev-ahead/beaglev-ahead/-/tree/main/d= ocs Signed-off-by: Drew Fustini --- arch/riscv/boot/dts/thead/th1520-beaglev-ahead.dts | 4 ---- .../boot/dts/thead/th1520-lichee-module-4a.dtsi | 4 ---- arch/riscv/boot/dts/thead/th1520.dtsi | 24 ++++++++----------= ---- 3 files changed, 9 insertions(+), 23 deletions(-) diff --git a/arch/riscv/boot/dts/thead/th1520-beaglev-ahead.dts b/arch/risc= v/boot/dts/thead/th1520-beaglev-ahead.dts index 55f1ed0cb433..1180e41c7b07 100644 --- a/arch/riscv/boot/dts/thead/th1520-beaglev-ahead.dts +++ b/arch/riscv/boot/dts/thead/th1520-beaglev-ahead.dts @@ -44,10 +44,6 @@ &osc_32k { clock-frequency =3D <32768>; }; =20 -&apb_clk { - clock-frequency =3D <62500000>; -}; - &dmac0 { status =3D "okay"; }; diff --git a/arch/riscv/boot/dts/thead/th1520-lichee-module-4a.dtsi b/arch/= riscv/boot/dts/thead/th1520-lichee-module-4a.dtsi index 762eceb415f8..78977bdbbe3d 100644 --- a/arch/riscv/boot/dts/thead/th1520-lichee-module-4a.dtsi +++ b/arch/riscv/boot/dts/thead/th1520-lichee-module-4a.dtsi @@ -25,10 +25,6 @@ &osc_32k { clock-frequency =3D <32768>; }; =20 -&apb_clk { - clock-frequency =3D <62500000>; -}; - &dmac0 { status =3D "okay"; }; diff --git a/arch/riscv/boot/dts/thead/th1520.dtsi b/arch/riscv/boot/dts/th= ead/th1520.dtsi index ce3a0847aa9c..d05002ad7c96 100644 --- a/arch/riscv/boot/dts/thead/th1520.dtsi +++ b/arch/riscv/boot/dts/thead/th1520.dtsi @@ -135,12 +135,6 @@ osc_32k: 32k-oscillator { #clock-cells =3D <0>; }; =20 - apb_clk: apb-clk-clock { - compatible =3D "fixed-clock"; - clock-output-names =3D "apb_clk"; - #clock-cells =3D <0>; - }; - soc { compatible =3D "simple-bus"; interrupt-parent =3D <&plic>; @@ -325,7 +319,7 @@ dmac0: dma-controller@ffefc00000 { compatible =3D "snps,axi-dma-1.01a"; reg =3D <0xff 0xefc00000 0x0 0x1000>; interrupts =3D <27 IRQ_TYPE_LEVEL_HIGH>; - clocks =3D <&apb_clk>, <&apb_clk>; + clocks =3D <&clk CLK_PERI_APB_PCLK>, <&clk CLK_PERI_APB_PCLK>; clock-names =3D "core-clk", "cfgr-clk"; #dma-cells =3D <1>; dma-channels =3D <4>; @@ -340,7 +334,7 @@ dmac0: dma-controller@ffefc00000 { timer0: timer@ffefc32000 { compatible =3D "snps,dw-apb-timer"; reg =3D <0xff 0xefc32000 0x0 0x14>; - clocks =3D <&apb_clk>; + clocks =3D <&clk CLK_PERI_APB_PCLK>; clock-names =3D "timer"; interrupts =3D <16 IRQ_TYPE_LEVEL_HIGH>; status =3D "disabled"; @@ -349,7 +343,7 @@ timer0: timer@ffefc32000 { timer1: timer@ffefc32014 { compatible =3D "snps,dw-apb-timer"; reg =3D <0xff 0xefc32014 0x0 0x14>; - clocks =3D <&apb_clk>; + clocks =3D <&clk CLK_PERI_APB_PCLK>; clock-names =3D "timer"; interrupts =3D <17 IRQ_TYPE_LEVEL_HIGH>; status =3D "disabled"; @@ -358,7 +352,7 @@ timer1: timer@ffefc32014 { timer2: timer@ffefc32028 { compatible =3D "snps,dw-apb-timer"; reg =3D <0xff 0xefc32028 0x0 0x14>; - clocks =3D <&apb_clk>; + clocks =3D <&clk CLK_PERI_APB_PCLK>; clock-names =3D "timer"; interrupts =3D <18 IRQ_TYPE_LEVEL_HIGH>; status =3D "disabled"; @@ -367,7 +361,7 @@ timer2: timer@ffefc32028 { timer3: timer@ffefc3203c { compatible =3D "snps,dw-apb-timer"; reg =3D <0xff 0xefc3203c 0x0 0x14>; - clocks =3D <&apb_clk>; + clocks =3D <&clk CLK_PERI_APB_PCLK>; clock-names =3D "timer"; interrupts =3D <19 IRQ_TYPE_LEVEL_HIGH>; status =3D "disabled"; @@ -398,7 +392,7 @@ uart5: serial@fff7f0c000 { timer4: timer@ffffc33000 { compatible =3D "snps,dw-apb-timer"; reg =3D <0xff 0xffc33000 0x0 0x14>; - clocks =3D <&apb_clk>; + clocks =3D <&clk CLK_PERI_APB_PCLK>; clock-names =3D "timer"; interrupts =3D <20 IRQ_TYPE_LEVEL_HIGH>; status =3D "disabled"; @@ -407,7 +401,7 @@ timer4: timer@ffffc33000 { timer5: timer@ffffc33014 { compatible =3D "snps,dw-apb-timer"; reg =3D <0xff 0xffc33014 0x0 0x14>; - clocks =3D <&apb_clk>; + clocks =3D <&clk CLK_PERI_APB_PCLK>; clock-names =3D "timer"; interrupts =3D <21 IRQ_TYPE_LEVEL_HIGH>; status =3D "disabled"; @@ -416,7 +410,7 @@ timer5: timer@ffffc33014 { timer6: timer@ffffc33028 { compatible =3D "snps,dw-apb-timer"; reg =3D <0xff 0xffc33028 0x0 0x14>; - clocks =3D <&apb_clk>; + clocks =3D <&clk CLK_PERI_APB_PCLK>; clock-names =3D "timer"; interrupts =3D <22 IRQ_TYPE_LEVEL_HIGH>; status =3D "disabled"; @@ -425,7 +419,7 @@ timer6: timer@ffffc33028 { timer7: timer@ffffc3303c { compatible =3D "snps,dw-apb-timer"; reg =3D <0xff 0xffc3303c 0x0 0x14>; - clocks =3D <&apb_clk>; + clocks =3D <&clk CLK_PERI_APB_PCLK>; clock-names =3D "timer"; interrupts =3D <23 IRQ_TYPE_LEVEL_HIGH>; status =3D "disabled"; --=20 2.34.1 From nobody Tue Dec 16 16:42:07 2025 Received: from mail-pf1-f173.google.com (mail-pf1-f173.google.com [209.85.210.173]) (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 7010216EB5B for ; Thu, 11 Jul 2024 16:56:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720716998; cv=none; b=onifC42MZp/MX9IhznVA6PEJtSHJ+IwNp7Nu6A0C71Gehhn2WqFC0tBeZEgVTcFe/Gggy9Pc4AcZm44zpzZOKor08Jj67VwuY/sIMvkU13G/kB13b7lJHTO7OWEehWb0p9OJtLVp3XxQpPx14UrKS+gv27TBJTLsAa3BRVBjylE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720716998; c=relaxed/simple; bh=1YUFcjPStRQXnRCkm7LFCYqYtH2keuIc2Ndi6ymcweU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ftIfLux7g1cVlgU4ZaE4+JjR8YoFTnHnevv/yOseqfo6TucoW6IciCFbLoqSmXq/wRbCAGJVv9Tr27qmYY5VPpFBvulMvISZ7lD3bDM2W4i3EOp+Y8OsWySgdm9FagLYXhzEbxSnLMClYjAe/RzBvbl8BfzSlN/4kSQmrruW7OI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=tenstorrent.com; spf=pass smtp.mailfrom=tenstorrent.com; dkim=pass (2048-bit key) header.d=tenstorrent.com header.i=@tenstorrent.com header.b=QLu8Yi8W; arc=none smtp.client-ip=209.85.210.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=tenstorrent.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tenstorrent.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tenstorrent.com header.i=@tenstorrent.com header.b="QLu8Yi8W" Received: by mail-pf1-f173.google.com with SMTP id d2e1a72fcca58-70b09cb7776so979081b3a.1 for ; Thu, 11 Jul 2024 09:56:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tenstorrent.com; s=google; t=1720716997; x=1721321797; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=RnFMVS1MfqfzWdRfEx5FfQB3Afj3yo7GkFlPsBGziDs=; b=QLu8Yi8W9jXhBwmTH8L5/MsKKkFI/yMruLTuhGBDK7XuCDsTbEC7BxNsjrwW+IxBuf me1C51CHACd5fGWZoUjetloR5FVyfmjCzcxnz0rucexDJm02R2cTz8lFMvhHlGe7JvzF yNn5YD8W0X+MFwJso43xJzq0JWmnK4HsWLSWwo/xztHaaf5IbvET385haQ4xULjFWFWm tpbr98yvtrQDaoyAgZGCMZp8PUI/cumQMP3I9L1eWU0tQrBRSUv0sipqEnxIz/76g0e8 b6VT4l5/86PbHYHTbI8OVhrc2mk+2PQh1p+PZk3mxmG7AB1JN34SbWp1Lq7qw4fbIUW4 F05A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720716997; x=1721321797; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=RnFMVS1MfqfzWdRfEx5FfQB3Afj3yo7GkFlPsBGziDs=; b=cf3G2Z1fCy+Uqijr2BrX3K6eAYby08tyIDUleuc28T0lW4PYmYz91S+ylWbDXVtTrX /DXvm4LQF0ivo+5eYqd3V7qXBrsoUzIGjwDus42OX8PX13AhxyBWbY55e4vx9q5/Wj1/ +SGiDOoVCZ9voqtnhiezCeEn1c53LThGu8+oNt7r0bfNmopmpkI9fMQilNQmt9r1NCBv tXFcuX3nKe0m/dnUpFJNz+JDhERROsQn9Zs7l0FbM2yT3vRR5zaPygMW1b5No2UnqUvX KRICrNx+4RLFB4h/LDR7vFyDQddTpaCOM4rdHjYw4ZR14CrzyfwJuZkqSQWvu/qg2zCo RXiA== X-Forwarded-Encrypted: i=1; AJvYcCVZYv+r+W3ea6FN1FtCBP9z6e9FURBgfcYZwUnTUjIKOFFXeJM7cM2Q/bMauj4gnKDvGdp12rei+oIG8ohAZZMm2Vwy8f/GW5BYm+ls X-Gm-Message-State: AOJu0Yx20It/ubP37HwzlcJ7hpaoqsMGSyiIQfwaATIR7SDazzUIFWfO uteSs0qa9rnK6JDVnrYchY4sgV9xg6eev1bSYTUOVMdexBK1mjWF0wfwTIi/P58= X-Google-Smtp-Source: AGHT+IGS+uYFXfGJ90lMZHo8zEZEN9G4YU5Eh+g8USyZFzpQSYTOEhmT81CJZkVjdrCsmZvpPP5WZQ== X-Received: by 2002:a05:6a00:982:b0:70a:97d9:5b9e with SMTP id d2e1a72fcca58-70b435422ccmr9355831b3a.10.1720716996791; Thu, 11 Jul 2024 09:56:36 -0700 (PDT) Received: from [127.0.1.1] ([2601:1c2:1802:170:5ee9:fea0:d9de:cee8]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-787089bc5f6sm1360038a12.92.2024.07.11.09.56.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Jul 2024 09:56:36 -0700 (PDT) From: Drew Fustini Date: Thu, 11 Jul 2024 09:56:25 -0700 Subject: [PATCH v3 7/7] riscv: dts: thead: add clock to TH1520 gpio nodes Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20240711-th1520-clk-v3-7-6ff17bb318fb@tenstorrent.com> References: <20240711-th1520-clk-v3-0-6ff17bb318fb@tenstorrent.com> In-Reply-To: <20240711-th1520-clk-v3-0-6ff17bb318fb@tenstorrent.com> To: Jisheng Zhang , Guo Ren , Fu Wei , Yangtao Li , Thomas Bonnefille , Emil Renner Berthing , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Paul Walmsley , Palmer Dabbelt , Albert Ou Cc: linux-riscv@lists.infradead.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Drew Fustini X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1720716985; l=1705; i=dfustini@tenstorrent.com; s=20230430; h=from:subject:message-id; bh=1YUFcjPStRQXnRCkm7LFCYqYtH2keuIc2Ndi6ymcweU=; b=xWMNMMf5ekN/VYMwCX4FKmLzMFMloIZ7DBupsg48lPSc0R8C8P8pGDv0fotGiJvk2zgTldVTs naf1OfccBxoDU7TIFEin5viNRAEti7jbOgJfpdSDyNt29e7mjJpUsBG X-Developer-Key: i=dfustini@tenstorrent.com; a=ed25519; pk=p3GKE9XFmjhwAayAHG4U108yag7V8xQVd4zJLdW0g7g= Add clock property to TH1520 gpio controller nodes. These clock gates refer to corresponding enable bits in the peripheral clock gate control register. Refer to register PERI_CLK_CFG in section 4.4.2.2.52 of the TH1520 System User Manual. Link: https://git.beagleboard.org/beaglev-ahead/beaglev-ahead/-/tree/main/d= ocs Signed-off-by: Drew Fustini --- arch/riscv/boot/dts/thead/th1520.dtsi | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/riscv/boot/dts/thead/th1520.dtsi b/arch/riscv/boot/dts/th= ead/th1520.dtsi index d05002ad7c96..351e09beab70 100644 --- a/arch/riscv/boot/dts/thead/th1520.dtsi +++ b/arch/riscv/boot/dts/thead/th1520.dtsi @@ -237,6 +237,7 @@ gpio2: gpio@ffe7f34000 { reg =3D <0xff 0xe7f34000 0x0 0x1000>; #address-cells =3D <1>; #size-cells =3D <0>; + clocks =3D <&clk CLK_GPIO2>; =20 portc: gpio-controller@0 { compatible =3D "snps,dw-apb-gpio-port"; @@ -255,6 +256,7 @@ gpio3: gpio@ffe7f38000 { reg =3D <0xff 0xe7f38000 0x0 0x1000>; #address-cells =3D <1>; #size-cells =3D <0>; + clocks =3D <&clk CLK_GPIO3>; =20 portd: gpio-controller@0 { compatible =3D "snps,dw-apb-gpio-port"; @@ -273,6 +275,7 @@ gpio0: gpio@ffec005000 { reg =3D <0xff 0xec005000 0x0 0x1000>; #address-cells =3D <1>; #size-cells =3D <0>; + clocks =3D <&clk CLK_GPIO0>; =20 porta: gpio-controller@0 { compatible =3D "snps,dw-apb-gpio-port"; @@ -291,6 +294,7 @@ gpio1: gpio@ffec006000 { reg =3D <0xff 0xec006000 0x0 0x1000>; #address-cells =3D <1>; #size-cells =3D <0>; + clocks =3D <&clk CLK_GPIO1>; =20 portb: gpio-controller@0 { compatible =3D "snps,dw-apb-gpio-port"; --=20 2.34.1