From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qt1-f171.google.com (mail-qt1-f171.google.com [209.85.160.171]) (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 CB5291D5CC2 for ; Fri, 18 Apr 2025 14:54:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744988050; cv=none; b=LEaljXpMSS4g0ps9eH8kXmN2NsN2UE9Yb5grxqGYDbUpOmzpyUOt6941NCa0A83sEXD9xao7EK7bpOB1leZLPXKgH4KLaOyr5jF2Ft4Cky1GbaS1XURQAduhZGsyUqH8rE82PzvDORGXazJIavEjzoG2lWAw/9VFYRkz1/tDjaI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744988050; c=relaxed/simple; bh=JbvxIKNnm2l02MeokP48X8vc1GIBXzEECfh/a24p9gk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=nzaFtih5nS7jF12oxcXls1A2fc8TvR00EShNzc4hWd6W1vui7SyiBht8LS78eeKrKiCi/iunZSggcGs8nSVPN9qyiIzMOhOngk7wca0pDCjM3k3ncc0HTrsmZmdjIJsFY5soRPWyi4yZMxLucgLTF1kmip5YcTHvRZZtERa2ecM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=riscstar.com; spf=pass smtp.mailfrom=riscstar.com; dkim=pass (2048-bit key) header.d=riscstar-com.20230601.gappssmtp.com header.i=@riscstar-com.20230601.gappssmtp.com header.b=oxQ48Qmo; arc=none smtp.client-ip=209.85.160.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=riscstar.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=riscstar.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=riscstar-com.20230601.gappssmtp.com header.i=@riscstar-com.20230601.gappssmtp.com header.b="oxQ48Qmo" Received: by mail-qt1-f171.google.com with SMTP id d75a77b69052e-477296dce8dso18122691cf.3 for ; Fri, 18 Apr 2025 07:54:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=riscstar-com.20230601.gappssmtp.com; s=20230601; t=1744988048; x=1745592848; darn=vger.kernel.org; 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=81a1v+nMC7nJeIGTMZQ54emwTNg/YN8dMbbTK1LgyT8=; b=oxQ48Qmo0DEnC3aND+aVjPKg1cpYtPLwcuYgf+cYTK+sTP8SEr1ngefMvdsYTmKyKd sdRSgCT9J5t3fJ8NPtfeYCQfzZBAMitewNVMVStWZ2dJa0HsLm9RYdZ15LJoL5pSClLQ O7GQGAMIbMXDTv0DxSgWQyVYgmYXhOVqmH4W1JHLpx1xwuwtI85I4HNb1HZoJ1AchpGX 0YAbmbHIc79/AzE5FSq5snQCm6LuLMS05jmh+RVOu3yfPP1gGmAA0N6kOiJcAuApTpzt HZ5fLFduqurTe3DQ50wlegl1enZow9Ibdg+T7uNLFOZzTvQxtrl1LmLT2f6KObDmnl0X GyCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744988048; x=1745592848; 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=81a1v+nMC7nJeIGTMZQ54emwTNg/YN8dMbbTK1LgyT8=; b=EY+VDZmYoV2nNRz2k+zFJ/tjajeV45QGPxx6NKEK7XFqpgiUxsgYIVbeNhkjnI3uGS KAhPwP/f3aMs9zkc2HMLg/vQs2y4uopNVqm9LQIpfTyDOHNkvK0Px+TllFb0+LYvDU/L nhASA7YnGBC5/Kv31lmVskfEQC0VoyIBU2YyOICZsQX/K4YPejZg36x71n/Dj4Ap76ov 5laOBs5x1ipzIWhvlc4vf0Q6o0Hfs8OrQorQnkBg3vw/9amSneG0SHRaEH0DhrnUGcXp brxnWTy3+0nJ1uy4nP8/yy0CL8UwvyB3NYfU4b7NblhG8Wbqn3u3X0CeP1S39CP2LBwK NO8w== X-Forwarded-Encrypted: i=1; AJvYcCW/bLKBVp5kRF34wMt2O/1h4zswyYYjq1KeaLq0KGQy5EOfQBXgidAvXCOqbUv7z5ZWy6dsQzXGDJo=@vger.kernel.org X-Gm-Message-State: AOJu0YzabJR05tFHIZ8NuEBJXKkqqwT5surh1lCGgZmMEqQTSBlQ6nF5 1Jh0KYUna3U1kjScNk/BYFq+bvle3TB4G1pzJw62yF3Hx89oZInEYW6kpcGu81o= X-Gm-Gg: ASbGnctYDb2dmIvvl7Hrzyf4L+2Ghx/ntFv3dyWVIqnUtLSm/ACNPTV02FS1YPeFo3V Kjb+RrBf6EfvKYdTJO8n6xI8z9V8LylaKnGiksJdrvWMf6gfuhvpns9UkRe2Gm3sWWGOb8s8hkX B+g7BH6BFCApbDZYia5mPTkDt1vjAgjiFWY0eR1I7sdB06b2ZNxcRrZvWrKQZ8uSARCB+PlsNGt hRy9xVlRHAqndTMHrrcGJO+A7va77PXkb6XLVvwSKMADVSw3RsDhotaC2ywE4Ck32Y1LtGrnjhq /CJCvjJxKDFya2jyQL/x1bNMJ130EXWikbWmS1HYSSZASkNT/N7H+MRdhdanEQdX4T26OPVzQW2 +x3zFctfbgBANcw== X-Google-Smtp-Source: AGHT+IGnwYLPi26HcaYRuJb1HCtQR40oX+awr6yWA9tTAcIKCeZh7T5uLErh0fblqbjjE1+0Wh4r/Q== X-Received: by 2002:ac8:7d8f:0:b0:475:287:12fb with SMTP id d75a77b69052e-47aec4b6843mr45320001cf.36.1744988047731; Fri, 18 Apr 2025 07:54:07 -0700 (PDT) Received: from localhost.localdomain (c-73-228-159-35.hsd1.mn.comcast.net. [73.228.159.35]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-47ae9c16ddesm11329201cf.3.2025.04.18.07.54.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Apr 2025 07:54:07 -0700 (PDT) From: Alex Elder To: robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, mturquette@baylibre.com, sboyd@kernel.org Cc: p.zabel@pengutronix.de, dlan@gentoo.org, heylenay@4d2.org, guodong@riscstar.com, paul.walmsley@sifive.com, palmer@dabbelt.com, aou@eecs.berkeley.edu, spacemit@lists.linux.dev, devicetree@vger.kernel.org, linux-clk@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Krzysztof Kozlowski Subject: [PATCH v5 1/7] dt-bindings: soc: spacemit: define spacemit,k1-ccu resets Date: Fri, 18 Apr 2025 09:53:53 -0500 Message-ID: <20250418145401.2603648-2-elder@riscstar.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20250418145401.2603648-1-elder@riscstar.com> References: <20250418145401.2603648-1-elder@riscstar.com> Precedence: bulk X-Mailing-List: linux-clk@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit There are additional SpacemiT syscon CCUs whose registers control both clocks and resets: RCPU, RCPU2, and APBC2. Unlike those defined previously, these will (initially) support only resets. They do not incorporate power domain functionality. Previously the clock properties were required for all compatible nodes. Make that requirement only apply to the three existing CCUs (APBC, APMU, and MPMU), so that the new reset-only CCUs can go without specifying them. Define the index values for resets associated with all SpacemiT K1 syscon nodes, including those with clocks already defined, as well as the new ones (without clocks). Signed-off-by: Alex Elder Reviewed-by: Krzysztof Kozlowski --- .../soc/spacemit/spacemit,k1-syscon.yaml | 29 +++- .../dt-bindings/clock/spacemit,k1-syscon.h | 128 ++++++++++++++++++ 2 files changed, 150 insertions(+), 7 deletions(-) diff --git a/Documentation/devicetree/bindings/soc/spacemit/spacemit,k1-syscon.yaml b/Documentation/devicetree/bindings/soc/spacemit/spacemit,k1-syscon.yaml index 30aaf49da03d3..133a391ee68cd 100644 --- a/Documentation/devicetree/bindings/soc/spacemit/spacemit,k1-syscon.yaml +++ b/Documentation/devicetree/bindings/soc/spacemit/spacemit,k1-syscon.yaml @@ -19,6 +19,9 @@ properties: - spacemit,k1-syscon-apbc - spacemit,k1-syscon-apmu - spacemit,k1-syscon-mpmu + - spacemit,k1-syscon-rcpu + - spacemit,k1-syscon-rcpu2 + - spacemit,k1-syscon-apbc2 reg: maxItems: 1 @@ -47,9 +50,6 @@ properties: required: - compatible - reg - - clocks - - clock-names - - "#clock-cells" - "#reset-cells" allOf: @@ -57,13 +57,28 @@ allOf: properties: compatible: contains: - const: spacemit,k1-syscon-apbc + enum: + - spacemit,k1-syscon-apmu + - spacemit,k1-syscon-mpmu then: - properties: - "#power-domain-cells": false - else: required: - "#power-domain-cells" + else: + properties: + "#power-domain-cells": false + - if: + properties: + compatible: + contains: + enum: + - spacemit,k1-syscon-apbc + - spacemit,k1-syscon-apmu + - spacemit,k1-syscon-mpmu + then: + required: + - clocks + - clock-names + - "#clock-cells" additionalProperties: false diff --git a/include/dt-bindings/clock/spacemit,k1-syscon.h b/include/dt-bindings/clock/spacemit,k1-syscon.h index 35968ae982466..f5965dda3b905 100644 --- a/include/dt-bindings/clock/spacemit,k1-syscon.h +++ b/include/dt-bindings/clock/spacemit,k1-syscon.h @@ -78,6 +78,9 @@ #define CLK_APB 31 #define CLK_WDT_BUS 32 +/* MPMU resets */ +#define RESET_WDT 0 + /* APBC clocks */ #define CLK_UART0 0 #define CLK_UART2 1 @@ -180,6 +183,59 @@ #define CLK_TSEN_BUS 98 #define CLK_IPC_AP2AUD_BUS 99 +/* APBC resets */ +#define RESET_UART0 0 +#define RESET_UART2 1 +#define RESET_UART3 2 +#define RESET_UART4 3 +#define RESET_UART5 4 +#define RESET_UART6 5 +#define RESET_UART7 6 +#define RESET_UART8 7 +#define RESET_UART9 8 +#define RESET_GPIO 9 +#define RESET_PWM0 10 +#define RESET_PWM1 11 +#define RESET_PWM2 12 +#define RESET_PWM3 13 +#define RESET_PWM4 14 +#define RESET_PWM5 15 +#define RESET_PWM6 16 +#define RESET_PWM7 17 +#define RESET_PWM8 18 +#define RESET_PWM9 19 +#define RESET_PWM10 20 +#define RESET_PWM11 21 +#define RESET_PWM12 22 +#define RESET_PWM13 23 +#define RESET_PWM14 24 +#define RESET_PWM15 25 +#define RESET_PWM16 26 +#define RESET_PWM17 27 +#define RESET_PWM18 28 +#define RESET_PWM19 29 +#define RESET_SSP3 30 +#define RESET_RTC 31 +#define RESET_TWSI0 32 +#define RESET_TWSI1 33 +#define RESET_TWSI2 34 +#define RESET_TWSI4 35 +#define RESET_TWSI5 36 +#define RESET_TWSI6 37 +#define RESET_TWSI7 38 +#define RESET_TWSI8 39 +#define RESET_TIMERS1 40 +#define RESET_TIMERS2 41 +#define RESET_AIB 42 +#define RESET_ONEWIRE 43 +#define RESET_SSPA0 44 +#define RESET_SSPA1 45 +#define RESET_DRO 46 +#define RESET_IR 47 +#define RESET_TSEN 48 +#define RESET_IPC_AP2AUD 49 +#define RESET_CAN0 50 + /* APMU clocks */ #define CLK_CCI550 0 #define CLK_CPU_C0_HI 1 @@ -244,4 +300,76 @@ #define CLK_V2D 60 #define CLK_EMMC_BUS 61 +/* APMU resets */ +#define RESET_CCIC_4X 0 +#define RESET_CCIC1_PHY 1 +#define RESET_SDH_AXI 2 +#define RESET_SDH0 3 +#define RESET_SDH1 4 +#define RESET_SDH2 5 +#define RESET_USBP1_AXI 6 +#define RESET_USB_AXI 7 +#define RESET_USB3_0 8 +#define RESET_QSPI 9 +#define RESET_QSPI_BUS 10 +#define RESET_DMA 11 +#define RESET_AES 12 +#define RESET_VPU 13 +#define RESET_GPU 14 +#define RESET_EMMC 15 +#define RESET_EMMC_X 16 +#define RESET_AUDIO 17 +#define RESET_HDMI 18 +#define RESET_PCIE0 19 +#define RESET_PCIE1 20 +#define RESET_PCIE2 21 +#define RESET_EMAC0 22 +#define RESET_EMAC1 23 +#define RESET_JPG 24 +#define RESET_CCIC2PHY 25 +#define RESET_CCIC3PHY 26 +#define RESET_CSI 27 +#define RESET_ISP_CPP 28 +#define RESET_ISP_BUS 29 +#define RESET_ISP 30 +#define RESET_ISP_CI 31 +#define RESET_DPU_MCLK 32 +#define RESET_DPU_ESC 33 +#define RESET_DPU_HCLK 34 +#define RESET_DPU_SPIBUS 35 +#define RESET_DPU_SPI_HBUS 36 +#define RESET_V2D 37 +#define RESET_MIPI 38 +#define RESET_MC 39 + +/* RCPU resets */ +#define RESET_RCPU_SSP0 0 +#define RESET_RCPU_I2C0 1 +#define RESET_RCPU_UART1 2 +#define RESET_RCPU_IR 3 +#define RESET_RCPU_CAN 4 +#define RESET_RCPU_UART0 5 +#define RESET_RCPU_HDMI_AUDIO 6 + +/* RCPU2 resets */ +#define RESET_RCPU2_PWM0 0 +#define RESET_RCPU2_PWM1 1 +#define RESET_RCPU2_PWM2 2 +#define RESET_RCPU2_PWM3 3 +#define RESET_RCPU2_PWM4 4 +#define RESET_RCPU2_PWM5 5 +#define RESET_RCPU2_PWM6 6 +#define RESET_RCPU2_PWM7 7 +#define RESET_RCPU2_PWM8 8 +#define RESET_RCPU2_PWM9 9 + +/* APBC2 resets */ +#define RESET_APBC2_UART1 0 +#define RESET_APBC2_SSP2 1 +#define RESET_APBC2_TWSI3 2 +#define RESET_APBC2_RTC 3 +#define RESET_APBC2_TIMERS0 4 +#define RESET_APBC2_KPC 5 +#define RESET_APBC2_GPIO 6 + #endif /* _DT_BINDINGS_SPACEMIT_CCU_H_ */ -- 2.45.2