From patchwork Wed Feb 5 12:52:16 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andras Szemzo X-Patchwork-Id: 13960992 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 23E73C02194 for ; Wed, 5 Feb 2025 12:58:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=TSQeWzSgrb+Bgv6s0GnYuvjzz6MyzXd89J++ZXTBfTQ=; b=4EKPadHdYTxDhO5qr/ta1Gb8SI VMOXBeHY2L6LfmY2YYflH0Vrfn/kI7xydCsy+GLIKY2yvyNas2SN4O5AuTNO6eQScuWgZyDUdyCET GRQ1roM0DwOFUIPj4QhHbBf2ngdR8Z3xHOYrCHS91gMXwx5xjeVWcpHUK+QOUjVkuFEe6W63i2jEf B6C3isZyEZZHAOWdM1Og7ej73aBvykmXeekkfUzZSIX8bFydNO6f67U8z1+pf8hww8pbPREC3jNHb zetOC9AdwvXpmCU22Q1S1GSKpBgDHkV1iEsHfXwCKgw2dg6IdTdLf0DFWmYFJjQaXNzYP+EyUBXO8 NrbyQddw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tfeyt-00000003JGE-0T8d; Wed, 05 Feb 2025 12:58:15 +0000 Received: from mail-ej1-x634.google.com ([2a00:1450:4864:20::634]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tfetM-00000003Hnj-1ShO; Wed, 05 Feb 2025 12:52:33 +0000 Received: by mail-ej1-x634.google.com with SMTP id a640c23a62f3a-aa67ac42819so1007813266b.0; Wed, 05 Feb 2025 04:52:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1738759950; x=1739364750; darn=lists.infradead.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=TSQeWzSgrb+Bgv6s0GnYuvjzz6MyzXd89J++ZXTBfTQ=; b=JUdTkdqB9iah+3ngkUCUcky7DK1JmNODTAlE64vfPjAShsD2kNo+3A82Uo6C85d2Ee rQXDhc8cA/N6ISlaTu2RXO4UMg6ywH2pTrjOVcJPqhMReiXEgCJQ6oN3TAO8eXQOGnao eBus2Ze5n876pmFoG/DZHG1/AF9PUiGnMwztNazaeu3mKtnBHqbGuC6tZ2zGoLh/rqpr x0DJBMw/5EKuPpv+6zmLgJSH4Llsjq355mZPOEHiLamDWAPi1s+Qp1Whjkg13RBHGwkJ zmwO7BKOmCoxs1M3WA7zFicd+w7e72lN295Dq18k5S5UXf/XXsQ95OopIsCJKRCmNBgY k85w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738759950; x=1739364750; 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=TSQeWzSgrb+Bgv6s0GnYuvjzz6MyzXd89J++ZXTBfTQ=; b=oyRvDjjzD/dkZsXSgyVa9Yom1jAQ2hrW0jZUuROh8oNPJpbtr0wLDB+kOSW+ejvstN FDjWi7+FsdNHiEUdoFDiwEUOZ7WE0VqoVWjY1SGLlpMzbvpbXddc61b18zSOWl1Ev3oQ Hs6XRgYF9S0XrzG5SpAvyo8c0fWtejUfZBSZ3E7szFjU70Hr+xjbLYj/EnNvYdncvhrf hWd7HwI3m8TCLPtEdNY7jyJodeVoBSgZjAreh7iNGAkInZM2c1sJr7cokandbB7QNFzt MB71ClZuL3RLs9ZKLa+DnSwdI+DlUCguoSxsUT9MvdQzaKzvuHGJqEtnZNcvsuXD0FPl GZEg== X-Forwarded-Encrypted: i=1; AJvYcCUSOIPdTGvbW3wMweqc7O9HjgQ9Ca4hSvpJlIQbcoplctUob1dQbgXGcMp8eXTuwl2/YeuKBruSiy0+@lists.infradead.org, AJvYcCWQlXo3O3TPZOEpZvEiVxoo4Gjlt6avglE3NquaLQSt5WDoDkV7cNGTBi0bWSx/2ajqSnICaf3DEb+Mtkk=@lists.infradead.org, AJvYcCX5FvKLOp31NK7gtgbIO7U9a0F5HDwSKvD4u2I4UXe0Idnko4EvUxtRZiCtmDquNrTi4gcjktQy69NljGNBNZ67@lists.infradead.org X-Gm-Message-State: AOJu0YwOlAbEcGcvZQwfqNYZPtJqF9F1g1JyDwjkt97Iv3YY7X5GTzlB 8K459nXDtC4qiINILwCjSEJi8l4ECmzjEAkzbUbougkcLJpJQRit X-Gm-Gg: ASbGncsBBdhgWTt+YW5uFp1dfR/ybPXTUv4404w6pkUs19bX3f/ocEjVYuJu2Sc7O10 cn/hkB4MNMxWBJfWvQA7VxRpRUEW8vMBnMv++fmEJLsWyjQ/1NmCr6o2XcuhXtFWrM+XXZXb5CR UlXBdWVH0eP9woHGLjC4TzeJOXAMAwelEZk4NBerj40Q7NNrgxqnBL78j1v5f4LHKLBHY9JGRL4 R3Ewpttobesd8GP10VKb7n7fUJpt/ZJstOg+igWgYCknWw09EkaIjDh5TejBxK2V351UxsO7sWa TTDIsCHQIA32xMGA+4NWZypVix9JiF0VxH9XqaXuQwMm0A== X-Google-Smtp-Source: AGHT+IGecgfsMcG35UqT0e1WE5j5jytX3/spRmqUEZGqCE6i0UxnZyh0jUtBcSjoqCNwAvn31NH/Fg== X-Received: by 2002:a17:907:7254:b0:aab:740f:e467 with SMTP id a640c23a62f3a-ab75e214c28mr230820566b.8.1738759950159; Wed, 05 Feb 2025 04:52:30 -0800 (PST) Received: from localhost.localdomain (185.174.17.62.zt.hu. [185.174.17.62]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5dc724055e5sm11559997a12.45.2025.02.05.04.52.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Feb 2025 04:52:29 -0800 (PST) From: Andras Szemzo To: Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Linus Walleij , Philipp Zabel , Maxime Ripard Cc: Vinod Koul , Kishon Vijay Abraham I , Ulf Hansson , Paul Walmsley , Palmer Dabbelt , Albert Ou , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Florian Fainelli , linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, linux-gpio@vger.kernel.org, linux-pm@vger.kernel.org, linux-riscv@lists.infradead.org Subject: [PATCH v2 01/10] clk: sunxi-ng: allow key feature in ccu reset and gate Date: Wed, 5 Feb 2025 13:52:16 +0100 Message-Id: <20250205125225.1152849-2-szemzo.andras@gmail.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250205125225.1152849-1-szemzo.andras@gmail.com> References: <20250205125225.1152849-1-szemzo.andras@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250205_045232_409715_7CE0DA53 X-CRM114-Status: GOOD ( 16.00 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Some newer SoCs, like V853 has reset and gate registers, what can be write only with fixed key value. Move this value from ccu_mux and reuse in the reset code, and also introduce a new macro to support writing gate registers with a key. Signed-off-by: Andras Szemzo --- drivers/clk/sunxi-ng/ccu_common.h | 2 ++ drivers/clk/sunxi-ng/ccu_gate.c | 6 ++++++ drivers/clk/sunxi-ng/ccu_gate.h | 14 ++++++++++++++ drivers/clk/sunxi-ng/ccu_mux.c | 4 +--- drivers/clk/sunxi-ng/ccu_reset.c | 7 +++++++ drivers/clk/sunxi-ng/ccu_reset.h | 2 +- 6 files changed, 31 insertions(+), 4 deletions(-) diff --git a/drivers/clk/sunxi-ng/ccu_common.h b/drivers/clk/sunxi-ng/ccu_common.h index dd330426a6e5..36132cb8b920 100644 --- a/drivers/clk/sunxi-ng/ccu_common.h +++ b/drivers/clk/sunxi-ng/ccu_common.h @@ -23,6 +23,8 @@ /* MMC timing mode switch bit */ #define CCU_MMC_NEW_TIMING_MODE BIT(30) +#define CCU_KEY_VALUE 0x16aa0000 + struct device_node; struct ccu_common { diff --git a/drivers/clk/sunxi-ng/ccu_gate.c b/drivers/clk/sunxi-ng/ccu_gate.c index ac52fd6bff67..a7ffaa8d3cb6 100644 --- a/drivers/clk/sunxi-ng/ccu_gate.c +++ b/drivers/clk/sunxi-ng/ccu_gate.c @@ -20,6 +20,9 @@ void ccu_gate_helper_disable(struct ccu_common *common, u32 gate) spin_lock_irqsave(common->lock, flags); reg = readl(common->base + common->reg); + if (common->features & CCU_FEATURE_KEY_FIELD) + reg |= CCU_KEY_VALUE; + writel(reg & ~gate, common->base + common->reg); spin_unlock_irqrestore(common->lock, flags); @@ -44,6 +47,9 @@ int ccu_gate_helper_enable(struct ccu_common *common, u32 gate) spin_lock_irqsave(common->lock, flags); reg = readl(common->base + common->reg); + if (common->features & CCU_FEATURE_KEY_FIELD) + reg |= CCU_KEY_VALUE; + writel(reg | gate, common->base + common->reg); spin_unlock_irqrestore(common->lock, flags); diff --git a/drivers/clk/sunxi-ng/ccu_gate.h b/drivers/clk/sunxi-ng/ccu_gate.h index dc05ce06737a..37e21fcdd931 100644 --- a/drivers/clk/sunxi-ng/ccu_gate.h +++ b/drivers/clk/sunxi-ng/ccu_gate.h @@ -68,6 +68,20 @@ struct ccu_gate { } \ } +#define SUNXI_CCU_GATE_HWS_WITH_KEY(_struct, _name, _parent, _reg, \ + _gate, _flags) \ + struct ccu_gate _struct = { \ + .enable = _gate, \ + .common = { \ + .reg = _reg, \ + .features = CCU_FEATURE_KEY_FIELD, \ + .hw.init = CLK_HW_INIT_HWS(_name, \ + _parent, \ + &ccu_gate_ops, \ + _flags), \ + } \ + } + #define SUNXI_CCU_GATE_HWS_WITH_PREDIV(_struct, _name, _parent, _reg, \ _gate, _prediv, _flags) \ struct ccu_gate _struct = { \ diff --git a/drivers/clk/sunxi-ng/ccu_mux.c b/drivers/clk/sunxi-ng/ccu_mux.c index d7ffbdeee9e0..127269ab20ea 100644 --- a/drivers/clk/sunxi-ng/ccu_mux.c +++ b/drivers/clk/sunxi-ng/ccu_mux.c @@ -12,8 +12,6 @@ #include "ccu_gate.h" #include "ccu_mux.h" -#define CCU_MUX_KEY_VALUE 0x16aa0000 - static u16 ccu_mux_get_prediv(struct ccu_common *common, struct ccu_mux_internal *cm, int parent_index) @@ -196,7 +194,7 @@ int ccu_mux_helper_set_parent(struct ccu_common *common, /* The key field always reads as zero. */ if (common->features & CCU_FEATURE_KEY_FIELD) - reg |= CCU_MUX_KEY_VALUE; + reg |= CCU_KEY_VALUE; reg &= ~GENMASK(cm->width + cm->shift - 1, cm->shift); writel(reg | (index << cm->shift), common->base + common->reg); diff --git a/drivers/clk/sunxi-ng/ccu_reset.c b/drivers/clk/sunxi-ng/ccu_reset.c index 55bc7c7cda0f..a9aee35c6617 100644 --- a/drivers/clk/sunxi-ng/ccu_reset.c +++ b/drivers/clk/sunxi-ng/ccu_reset.c @@ -9,6 +9,7 @@ #include #include "ccu_reset.h" +#include "ccu_common.h" static int ccu_reset_assert(struct reset_controller_dev *rcdev, unsigned long id) @@ -21,6 +22,9 @@ static int ccu_reset_assert(struct reset_controller_dev *rcdev, spin_lock_irqsave(ccu->lock, flags); reg = readl(ccu->base + map->reg); + if (map->features & CCU_FEATURE_KEY_FIELD) + reg |= CCU_KEY_VALUE; + writel(reg & ~map->bit, ccu->base + map->reg); spin_unlock_irqrestore(ccu->lock, flags); @@ -39,6 +43,9 @@ static int ccu_reset_deassert(struct reset_controller_dev *rcdev, spin_lock_irqsave(ccu->lock, flags); reg = readl(ccu->base + map->reg); + if (map->features & CCU_FEATURE_KEY_FIELD) + reg |= CCU_KEY_VALUE; + writel(reg | map->bit, ccu->base + map->reg); spin_unlock_irqrestore(ccu->lock, flags); diff --git a/drivers/clk/sunxi-ng/ccu_reset.h b/drivers/clk/sunxi-ng/ccu_reset.h index 941276a8ec2e..8da721ac3a7d 100644 --- a/drivers/clk/sunxi-ng/ccu_reset.h +++ b/drivers/clk/sunxi-ng/ccu_reset.h @@ -12,9 +12,9 @@ struct ccu_reset_map { u16 reg; u32 bit; + u32 features; }; - struct ccu_reset { void __iomem *base; const struct ccu_reset_map *reset_map; From patchwork Wed Feb 5 12:52:17 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andras Szemzo X-Patchwork-Id: 13960993 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3142CC02192 for ; Wed, 5 Feb 2025 12:59:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ZgfFrjRxyOW1xOgdcC7mwiMGS+SjeOrC7s5Z2O3ZWyY=; b=Wz9uRcGPgG/wLl4Ja7PvrN11M7 ouuSGkzaz5mwbFGvCd0vKvssSLFdbYsgE09UOpf8Y2AyIZ0L//bIHv1BHfZH7BLJrCpM7wIAYSMAQ tUM83CfoNVWHuPHw027ROdAnKkW+ivdFuDBeQ6Y4DXHD/5Oh7mF6OFj8fFeBAAXWWk4r43ekynNHD WKsNxsb71616TJ/hXFVH/A1RePviY5+RuR8vwVkwnKL5OC/ePNrCqCAbOJMtJxUiHZFOdiASlWHsg FqSVVj0U4hzvULqGJrRz6ZYhh87lviYkZECrIqUTK6+9M7zd6OcFz8tLZ84m4TZF3cU5S1UqhQLXl +PY/ZOqw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tff0F-00000003Jfl-09FZ; Wed, 05 Feb 2025 12:59:39 +0000 Received: from mail-ed1-x536.google.com ([2a00:1450:4864:20::536]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tfetO-00000003HoX-02eJ; Wed, 05 Feb 2025 12:52:35 +0000 Received: by mail-ed1-x536.google.com with SMTP id 4fb4d7f45d1cf-5dce3763140so521248a12.3; Wed, 05 Feb 2025 04:52:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1738759952; x=1739364752; darn=lists.infradead.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=ZgfFrjRxyOW1xOgdcC7mwiMGS+SjeOrC7s5Z2O3ZWyY=; b=dEqJ1rtT3hTGstlwLMx0SSFQECbTFyUInca5pl6FMnEJ5pThvKk/IP3l79YTXR8FZ2 3btazh3rxDpbatbmFdVzGx9e2NdECyUO+Pcs1qURoIY/bMBHfv0+t1U031sNBn2+xVWQ COsPxTpyJ/2AEZOGo05tIxISSd/cia/C55Oc7ugjJ+vV7UlUXPE8TI18w/qa+8L7UJ7K 4TCQxMjA3qcCYbjnGMh/7cQvgLEKYIHnP47yxe/4vhgBESulWSZzqAHCXsZEwAt+QcYO 0lZlAWUMlDrAVqQyMkaoYe91QsBWyeZxJhmqzEXeahkUkLsL4KQ+2RzYariev8yBmlnW otuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738759952; x=1739364752; 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=ZgfFrjRxyOW1xOgdcC7mwiMGS+SjeOrC7s5Z2O3ZWyY=; b=By5jx8L/e94wePAHfX1ziNE7fY8eXgEBUhWWclqQHY3mn7yrqUSBB3zQUQows6O8+q rZ3vztMg02rR0IkcwBQyU+/kC1El93PYyMdGqlRkZjMYpz/IgtKF9GLTczwYCGvw88jE My/Eevr0nXm9ONdUpVjkOJp12VcnAXd1kBzi0oeUH3W+3VR+bXMbD9MadGXT5NhlP7iD 2FwGiw4m5UAWuUXimPPBeDu7H6PQWkosvCAS8EvMnkAF1BrerMCA64exOfkk9oVZHUuL 7IsBT6mEHMoG8KPayvBRjKNDExYHRbK3AznCupReU0y598nFGFA9sdRm2XesZI/EAHFs 28Yg== X-Forwarded-Encrypted: i=1; AJvYcCUN4ZX41Op8NE2UWDyq1MHn7v3z/jnURG4yH0356t9MjMCW/lhclP5eK/xXZP7bKr1908BbThHLDzXN+4M=@lists.infradead.org, AJvYcCW6ru4SywUSeZ9cOs7fySOdEEFUbw7I5ZeVcUgDH21ma+dVh0YN2Pp+KrFzeMbhAwsvgYL9W7yd3/xC@lists.infradead.org, AJvYcCWccwvVYJsEHL6NEblpUu3LdHH7CFphBKmBDy5wSdBf4DlHlqCU/jGuN5jKuygeww+NEMkH244fXypYMCKS04b8@lists.infradead.org X-Gm-Message-State: AOJu0Yx+2VonQmKdTwxAe7pNHuLUQdTjaqB2YP5kBIfi/IqTIlzpxnDb 5In3t1FT1tkVWrdqgmlhojeaUwF0Fg5SVQEDiSlVHhwehRhpZOtH X-Gm-Gg: ASbGncvo15l7aYZIy6cJL8YQ6OkZQeDJArseG0IcbiGGjI0yV/EY/YPli/QhnZFRj4b pe1zt7StwcM3eEw5qiODLZck+VY/70P+o0dixozAxCWsWdF3kza6s9zmUwW0Ugyvyry+mu+Hx/Y 1Vp2Ufo+lBt+Tvj/SagTvplfjdCJeoL5w7vEjht4gyBeZlu5tbADufFpeYq/h1kfl39IOelKJGi emUJ2CyTauWkIzstHFlMxTZfTB/5SyGv/i+NMVG8CfcexDTD5Yad9WPWdQZv7nCvO5xDes7+bW9 XOgcqXWJ9Zaeb+pv0g+janeytavll/4Y5jg8Qa+ivFDw/Q== X-Google-Smtp-Source: AGHT+IEAbQlJM9YpeCWJhaXrMd8JjdEQmk1PIGdg1MxSU0j0zzL77t1J5QeVhoIykZ9fWSW5KttwGw== X-Received: by 2002:a05:6402:350c:b0:5d0:b51c:8479 with SMTP id 4fb4d7f45d1cf-5dcdb7179ccmr3428449a12.10.1738759951997; Wed, 05 Feb 2025 04:52:31 -0800 (PST) Received: from localhost.localdomain (185.174.17.62.zt.hu. [185.174.17.62]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5dc724055e5sm11559997a12.45.2025.02.05.04.52.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Feb 2025 04:52:31 -0800 (PST) From: Andras Szemzo To: Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Linus Walleij , Philipp Zabel , Maxime Ripard Cc: Vinod Koul , Kishon Vijay Abraham I , Ulf Hansson , Paul Walmsley , Palmer Dabbelt , Albert Ou , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Florian Fainelli , linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, linux-gpio@vger.kernel.org, linux-pm@vger.kernel.org, linux-riscv@lists.infradead.org Subject: [PATCH v2 02/10] pinctrl: sunxi: add driver for Allwinner V853 Date: Wed, 5 Feb 2025 13:52:17 +0100 Message-Id: <20250205125225.1152849-3-szemzo.andras@gmail.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250205125225.1152849-1-szemzo.andras@gmail.com> References: <20250205125225.1152849-1-szemzo.andras@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250205_045234_048220_504690AE X-CRM114-Status: GOOD ( 18.15 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The V853 family has multiple package variants, from BGA to QFN88. The latter has co-packaged DRAM and fewer pins, and less features (pin muxes). All family members can be supported by a single driver, as the available pins with allowed muxes is the same across the devices. This new pinctrl driver depends on the new sunxi device-tree based mux support patch series [1]. [1]: https://lore.kernel.org/linux-sunxi/20241111005750.13071-1-andre.przywara@arm.com/T/ Signed-off-by: Andras Szemzo --- drivers/pinctrl/sunxi/Kconfig | 5 ++ drivers/pinctrl/sunxi/Makefile | 1 + drivers/pinctrl/sunxi/pinctrl-sun8i-v853.c | 53 ++++++++++++++++++++++ 3 files changed, 59 insertions(+) create mode 100644 drivers/pinctrl/sunxi/pinctrl-sun8i-v853.c diff --git a/drivers/pinctrl/sunxi/Kconfig b/drivers/pinctrl/sunxi/Kconfig index a78fdbbdfc0c..fac9c61039e2 100644 --- a/drivers/pinctrl/sunxi/Kconfig +++ b/drivers/pinctrl/sunxi/Kconfig @@ -81,6 +81,11 @@ config PINCTRL_SUN9I_A80_R default MACH_SUN9I select PINCTRL_SUNXI +config PINCTRL_SUN8I_V853 + bool "Support for the Allwinner V853/V851S/V851SE PIO" + default MACH_SUN8I + select PINCTRL_SUNXI + config PINCTRL_SUN20I_D1 bool "Support for the Allwinner D1 PIO" default MACH_SUN8I || (RISCV && ARCH_SUNXI) diff --git a/drivers/pinctrl/sunxi/Makefile b/drivers/pinctrl/sunxi/Makefile index 2ff5a55927ad..8937b56b2ef4 100644 --- a/drivers/pinctrl/sunxi/Makefile +++ b/drivers/pinctrl/sunxi/Makefile @@ -20,6 +20,7 @@ obj-$(CONFIG_PINCTRL_SUN8I_A83T_R) += pinctrl-sun8i-a83t-r.o obj-$(CONFIG_PINCTRL_SUN8I_H3) += pinctrl-sun8i-h3.o obj-$(CONFIG_PINCTRL_SUN8I_H3_R) += pinctrl-sun8i-h3-r.o obj-$(CONFIG_PINCTRL_SUN8I_V3S) += pinctrl-sun8i-v3s.o +obj-$(CONFIG_PINCTRL_SUN8I_V853) += pinctrl-sun8i-v853.o obj-$(CONFIG_PINCTRL_SUN20I_D1) += pinctrl-sun20i-d1.o obj-$(CONFIG_PINCTRL_SUN50I_H5) += pinctrl-sun50i-h5.o obj-$(CONFIG_PINCTRL_SUN50I_H6) += pinctrl-sun50i-h6.o diff --git a/drivers/pinctrl/sunxi/pinctrl-sun8i-v853.c b/drivers/pinctrl/sunxi/pinctrl-sun8i-v853.c new file mode 100644 index 000000000000..fb2112ee12d0 --- /dev/null +++ b/drivers/pinctrl/sunxi/pinctrl-sun8i-v853.c @@ -0,0 +1,53 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Allwinner V853 SoC pinctrl driver. + * + * Copyright (c) 2025 Andras Szemzo + */ + +#include +#include +#include +#include +#include + +#include "pinctrl-sunxi.h" + +static const u8 v853_nr_bank_pins[SUNXI_PINCTRL_MAX_BANKS] = +/* PA PB PC PD PE PF PG PH PI */ + { 22, 0, 12, 23, 18, 7, 8, 16, 5 }; + +static const unsigned int v853_irq_bank_map[] = { 0, 2, 3, 4, 5, 6, 7, 8 }; + +static const u8 v853_irq_bank_muxes[SUNXI_PINCTRL_MAX_BANKS] = +/* PA PB PC PD PE PF PG PH PI */ + { 14, 0, 14, 14, 14, 14, 14, 14, 14 }; + +static struct sunxi_pinctrl_desc v853_pinctrl_data = { + .irq_banks = ARRAY_SIZE(v853_irq_bank_map), + .irq_bank_map = v853_irq_bank_map, + .io_bias_cfg_variant = BIAS_VOLTAGE_PIO_POW_MODE_SEL, +}; + +static int v853_pinctrl_probe(struct platform_device *pdev) +{ + return sunxi_pinctrl_dt_table_init(pdev, v853_nr_bank_pins, + v853_irq_bank_muxes, + &v853_pinctrl_data, + SUNXI_PINCTRL_NEW_REG_LAYOUT | + SUNXI_PINCTRL_ELEVEN_BANKS); +} + +static const struct of_device_id v853_pinctrl_match[] = { + { .compatible = "allwinner,sun8i-v853-pinctrl", }, + {} +}; + +static struct platform_driver v853_pinctrl_driver = { + .probe = v853_pinctrl_probe, + .driver = { + .name = "sun8i-v853-pinctrl", + .of_match_table = v853_pinctrl_match, + }, +}; +builtin_platform_driver(v853_pinctrl_driver); From patchwork Wed Feb 5 12:52:18 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andras Szemzo X-Patchwork-Id: 13960999 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 282C2C02194 for ; Wed, 5 Feb 2025 13:01:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=2h7BTYhKIDGSovARV/kRMaz8LzJgfzBwpICZVS1kS+4=; b=wjqcN+/XYLMGjR/yZ2S7oLqLXq btN0IeTKOpbgBQh5x1blukttboTV8gD4nmBT9vZKxd60D1ttSsSvEAopx9rLcRh8SLnLquDqoEomx HBF1c806fcrRzhN+2pl5pxS52tFNaXap0fXYXhZllY/Omt8kgnmkIZAtNdrJYm8udFIUhVq3pAqmU hcyeGEXrhTIKy7ulvdMR8LJM+3hxERvWpaFUOIVWPj+EfA0co9I6XL0Khoi5onzjMZTJ0IljGaxp2 gC7wmO56wt3epNEgt5RAheUj7dSFnHAxSIR9ayD1nrtCiP7UGijou6ljZaUVke4YBTJGjubl9/P4R 9uuCDptQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tff1a-00000003Jwu-3XYB; Wed, 05 Feb 2025 13:01:02 +0000 Received: from mail-ed1-x529.google.com ([2a00:1450:4864:20::529]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tfetP-00000003HpV-2zM0; Wed, 05 Feb 2025 12:52:36 +0000 Received: by mail-ed1-x529.google.com with SMTP id 4fb4d7f45d1cf-5da12292b67so11086242a12.3; Wed, 05 Feb 2025 04:52:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1738759954; x=1739364754; darn=lists.infradead.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=2h7BTYhKIDGSovARV/kRMaz8LzJgfzBwpICZVS1kS+4=; b=j8GFGo6/0f9Z0MIDf0DThMY+XXJyrypG6WOT9doThiH6dK6qp1wpp0wunxevbsdynv AX7FPNwGUK3wWH9I4hP1KyL9qO3ewx8PjYOaeBvT1cBk7zv8gycpOfXiBKbnkpbkihhl PrManUM0/ZplnyJAjV0HhoH7W1kApCnyqbXywUxA475Xg871JSFbA2GgADUivhJCPodD WJ8VwOV9S719z/ltofPStzJpTMn1zjXDhZs1FwT+xw0sV88cQF/6iOHEZNL13GcDT5HY /g27eQoY3E1lREpTwyV7i+S9h2j1+z07e+f00MWGtjTQdj655LifKw2QHwAdp6NA/5nJ ShRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738759954; x=1739364754; 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=2h7BTYhKIDGSovARV/kRMaz8LzJgfzBwpICZVS1kS+4=; b=vozT8T4BZ5W/KvtZEF4s4RxyMmYWLtLsFQkjStgJo+4BD+iEwNPO4pzq2bialdVjrk xwp0yJf1wbvpmWSbG1lemibcSWeK8HZAeEP3Twaxh264zX8MkCQvOWADKo6aOvRR4QI+ I3hPIkyoiYlyB44eE29gmZ16gR4Iu6JwI8Vni0FHxiTltA/GtAJzSmN2K1PTRuHjnzKj fdBTpL9StUSDgcnVdx4hnnnqvwpr8fuPkXqSNhCUFcEgGL0/f4+3/WDJAlN1RpSoV4c/ ICovZY3pQVaxwpLJDlWjFMsuWAf5npqkQmIVuAa9RkhkKWTBrPrclmb9K+MvSXpslY5F 5Sww== X-Forwarded-Encrypted: i=1; AJvYcCUAozkGfObgG8N2ruQwfsSnSm7Jjhpwle3BrMfegOz1mWfDr11/aGMHdj057Fgc+MSqKTJpAP+Mb3x3@lists.infradead.org, AJvYcCUydkaJWrryr/TDXIR193xOoAGtlM06+SB1b9JH2+Hf+511OoEqqfQK8BwsNSuou3bDjvcnnm8Y8yd4u5c=@lists.infradead.org, AJvYcCVARFPbiaXqE3N6GA1aUkSwTV1c1PlpgMusVdqVdcrL+zHEvG4HkkugZcFgFLYWSnX5prYCIewW2xJevOdBvaY1@lists.infradead.org X-Gm-Message-State: AOJu0Yzq5utE0jGVZ/Z9RMVylA1JJR8kiIlXyETUEyBbV0ZC7pbIMxBz aSjfGgmcfQG2mwzU3m6RYsLeLP5pRKMrds299TklIdu0gRxOd8Ch X-Gm-Gg: ASbGncvUzaFvt+ypka2DFB4mC8L/wno4WFeS9+kt8XGjuOzM5POWgr93cRt2YTDWoqA kQpJeBpfHhrGtSpuMeZC9nSKc8k4T70PosorVOsApzDbW5OVqRQKWO/Dzu/WtbO71SOYNRlOtaL sdclok6TqY651HmVPSag3QOgHuZ92FVdH3Z/AT1qYP+2ReSV2+ojctMRd0bcz4QN2LMHRA7sHbr taj4W3ZYJT/mSlQyFBh7Ib2NvMu1nh1sZ4kIhIAKv00q8lV45hZQLxM1UDjityg3YK/vVOrZfHq j6uQCmMrDGVCr7W3obKns3oGE5vkCU54+C/tXM8iND5ZQw== X-Google-Smtp-Source: AGHT+IGGu/7AADk3D0HpZFHZbd5mDOa9V/c+jpDgka/onZHtiRlSlj8RdhKfxdaOzwjowoHiNYitlg== X-Received: by 2002:a05:6402:34c8:b0:5d0:c697:1f02 with SMTP id 4fb4d7f45d1cf-5dcdb7295c9mr6548115a12.17.1738759953701; Wed, 05 Feb 2025 04:52:33 -0800 (PST) Received: from localhost.localdomain (185.174.17.62.zt.hu. [185.174.17.62]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5dc724055e5sm11559997a12.45.2025.02.05.04.52.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Feb 2025 04:52:33 -0800 (PST) From: Andras Szemzo To: Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Linus Walleij , Philipp Zabel , Maxime Ripard Cc: Vinod Koul , Kishon Vijay Abraham I , Ulf Hansson , Paul Walmsley , Palmer Dabbelt , Albert Ou , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Florian Fainelli , linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, linux-gpio@vger.kernel.org, linux-pm@vger.kernel.org, linux-riscv@lists.infradead.org Subject: [PATCH v2 03/10] dt-bindings: clock: sunxi-ng: add compatibles for V853 Date: Wed, 5 Feb 2025 13:52:18 +0100 Message-Id: <20250205125225.1152849-4-szemzo.andras@gmail.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250205125225.1152849-1-szemzo.andras@gmail.com> References: <20250205125225.1152849-1-szemzo.andras@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250205_045235_752135_A6C43CA4 X-CRM114-Status: GOOD ( 14.67 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org V853 has 2 CCUs, add compatible strings for it. Signed-off-by: Andras Szemzo --- .../clock/allwinner,sun4i-a10-ccu.yaml | 3 + .../clock/allwinner,sun8i-v853-ccu.h | 132 ++++++++++++++++++ .../clock/allwinner,sun8i-v853-r-ccu.h | 16 +++ .../reset/allwinner,sun8i-v853-ccu.h | 60 ++++++++ .../reset/allwinner,sun8i-v853-r-ccu.h | 14 ++ 5 files changed, 225 insertions(+) create mode 100644 include/dt-bindings/clock/allwinner,sun8i-v853-ccu.h create mode 100644 include/dt-bindings/clock/allwinner,sun8i-v853-r-ccu.h create mode 100644 include/dt-bindings/reset/allwinner,sun8i-v853-ccu.h create mode 100644 include/dt-bindings/reset/allwinner,sun8i-v853-r-ccu.h diff --git a/Documentation/devicetree/bindings/clock/allwinner,sun4i-a10-ccu.yaml b/Documentation/devicetree/bindings/clock/allwinner,sun4i-a10-ccu.yaml index 1690b9d99c3d..9369d62284ed 100644 --- a/Documentation/devicetree/bindings/clock/allwinner,sun4i-a10-ccu.yaml +++ b/Documentation/devicetree/bindings/clock/allwinner,sun4i-a10-ccu.yaml @@ -33,6 +33,8 @@ properties: - allwinner,sun8i-r40-ccu - allwinner,sun8i-v3-ccu - allwinner,sun8i-v3s-ccu + - allwinner,sun8i-v853-ccu + - allwinner,sun8i-v853-r-ccu - allwinner,sun9i-a80-ccu - allwinner,sun20i-d1-ccu - allwinner,sun20i-d1-r-ccu @@ -103,6 +105,7 @@ else: compatible: enum: - allwinner,sun20i-d1-ccu + - allwinner,sun8i-v853-ccu - allwinner,sun50i-a100-ccu - allwinner,sun50i-h6-ccu - allwinner,sun50i-h616-ccu diff --git a/include/dt-bindings/clock/allwinner,sun8i-v853-ccu.h b/include/dt-bindings/clock/allwinner,sun8i-v853-ccu.h new file mode 100644 index 000000000000..cf56c168e1cd --- /dev/null +++ b/include/dt-bindings/clock/allwinner,sun8i-v853-ccu.h @@ -0,0 +1,132 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Copyright (C) 2024 Andras Szemzo + */ + +#ifndef _DT_BINDINGS_CLK_ALLWINNER_SUN8I_V85X_CCU_H_ +#define _DT_BINDINGS_CLK_ALLWINNER_SUN8I_V85X_CCU_H_ + +#define CLK_OSC12M 0 +#define CLK_PLL_CPU 1 +#define CLK_PLL_DDR 2 +#define CLK_PLL_PERIPH_4X 3 +#define CLK_PLL_PERIPH_2X 4 +#define CLK_PLL_PERIPH_800M 5 +#define CLK_PLL_PERIPH_480M 6 +#define CLK_PLL_PERIPH_600M 7 +#define CLK_PLL_PERIPH_400M 8 +#define CLK_PLL_PERIPH_300M 9 +#define CLK_PLL_PERIPH_200M 10 +#define CLK_PLL_PERIPH_160M 11 +#define CLK_PLL_PERIPH_150M 12 +#define CLK_PLL_VIDEO_4X 13 +#define CLK_PLL_VIDEO_2X 14 +#define CLK_PLL_VIDEO_1X 15 +#define CLK_PLL_CSI_4X 16 +#define CLK_PLL_AUDIO_DIV2 17 +#define CLK_PLL_AUDIO_DIV5 18 +#define CLK_PLL_AUDIO_4X 19 +#define CLK_PLL_AUDIO_1X 20 +#define CLK_PLL_NPU_4X 21 +#define CLK_CPU 22 +#define CLK_CPU_AXI 23 +#define CLK_CPU_APB 24 +#define CLK_AHB 25 +#define CLK_APB0 26 +#define CLK_APB1 27 +#define CLK_MBUS 28 +#define CLK_DE 29 +#define CLK_BUS_DE 30 +#define CLK_G2D 31 +#define CLK_BUS_G2D 32 +#define CLK_CE 33 +#define CLK_BUS_CE 34 +#define CLK_VE 35 +#define CLK_BUS_VE 36 +#define CLK_NPU 37 +#define CLK_BUS_NPU 38 +#define CLK_BUS_DMA 39 +#define CLK_BUS_MSGBOX0 40 +#define CLK_BUS_MSGBOX1 41 +#define CLK_BUS_SPINLOCK 42 +#define CLK_BUS_HSTIMER 43 +#define CLK_AVS 44 +#define CLK_BUS_DBG 45 +#define CLK_BUS_PWM 46 +#define CLK_BUS_IOMMU 47 +#define CLK_DRAM 48 +#define CLK_MBUS_DMA 49 +#define CLK_MBUS_VE 50 +#define CLK_MBUS_CE 51 +#define CLK_MBUS_CSI 52 +#define CLK_MBUS_ISP 53 +#define CLK_MBUS_G2D 54 +#define CLK_BUS_DRAM 55 +#define CLK_MMC0 56 +#define CLK_MMC1 57 +#define CLK_MMC2 58 +#define CLK_BUS_MMC0 59 +#define CLK_BUS_MMC1 60 +#define CLK_BUS_MMC2 61 +#define CLK_BUS_UART0 62 +#define CLK_BUS_UART1 63 +#define CLK_BUS_UART2 64 +#define CLK_BUS_UART3 65 +#define CLK_BUS_I2C0 66 +#define CLK_BUS_I2C1 67 +#define CLK_BUS_I2C2 68 +#define CLK_BUS_I2C3 69 +#define CLK_BUS_I2C4 70 +#define CLK_SPI0 71 +#define CLK_SPI1 72 +#define CLK_SPI2 73 +#define CLK_SPI3 74 +#define CLK_BUS_SPI0 75 +#define CLK_BUS_SPI1 76 +#define CLK_BUS_SPI2 77 +#define CLK_BUS_SPI3 78 +#define CLK_SPIF 79 +#define CLK_BUS_SPIF 80 +#define CLK_EMAC_25M 81 +#define CLK_BUS_EMAC 82 +#define CLK_BUS_GPADC 83 +#define CLK_BUS_THS 84 +#define CLK_I2S0 85 +#define CLK_I2S1 86 +#define CLK_BUS_I2S0 87 +#define CLK_BUS_I2S1 88 +#define CLK_DMIC 89 +#define CLK_BUS_DMIC 90 +#define CLK_AUDIO_CODEC_DAC 91 +#define CLK_AUDIO_CODEC_ADC 92 +#define CLK_BUS_AUDIO_CODEC 93 +#define CLK_USB_OHCI 94 +#define CLK_BUS_OHCI 95 +#define CLK_BUS_EHCI 96 +#define CLK_BUS_OTG 97 +#define CLK_BUS_DPSS_TOP 98 +#define CLK_MIPI_DSI 99 +#define CLK_BUS_MIPI_DSI 100 +#define CLK_TCON_LCD 101 +#define CLK_BUS_TCON_LCD 102 +#define CLK_CSI_TOP 103 +#define CLK_CSI_MCLK0 104 +#define CLK_CSI_MCLK1 105 +#define CLK_CSI_MCLK2 106 +#define CLK_BUS_CSI 107 +#define CLK_BUS_WIEGAND 108 +#define CLK_RISCV 109 +#define CLK_RISCV_AXI 110 +#define CLK_RISCV_CORE_GATE 111 +#define CLK_RISCV_CFG_GATE 112 +#define CLK_FANOUT_24M 113 +#define CLK_FANOUT_12M 114 +#define CLK_FANOUT_16M 115 +#define CLK_FANOUT_25M 116 +#define CLK_FANOUT_27M 117 +#define CLK_FANOUT_PCLK 118 +#define CLK_FANOUT0 119 +#define CLK_FANOUT1 120 +#define CLK_FANOUT2 121 + +#endif diff --git a/include/dt-bindings/clock/allwinner,sun8i-v853-r-ccu.h b/include/dt-bindings/clock/allwinner,sun8i-v853-r-ccu.h new file mode 100644 index 000000000000..48fe598b7bd8 --- /dev/null +++ b/include/dt-bindings/clock/allwinner,sun8i-v853-r-ccu.h @@ -0,0 +1,16 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Copyright (C) 2025 Andras Szemzo + */ + +#ifndef _DT_BINDINGS_CLK_ALLWINNER_SUN8I_V853_R_CCU_H_ +#define _DT_BINDINGS_CLK_ALLWINNER_SUN8I_V853_R_CCU_H_ + +#define CLK_R_AHB 0 +#define CLK_R_APB0 1 +#define CLK_BUS_R_TWD 2 +#define CLK_BUS_R_PPU 3 +#define CLK_BUS_R_RTC 4 +#define CLK_BUS_R_CPUCFG 5 + +#endif diff --git a/include/dt-bindings/reset/allwinner,sun8i-v853-ccu.h b/include/dt-bindings/reset/allwinner,sun8i-v853-ccu.h new file mode 100644 index 000000000000..e258117518aa --- /dev/null +++ b/include/dt-bindings/reset/allwinner,sun8i-v853-ccu.h @@ -0,0 +1,60 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Copyright (C) 2024 Andras Szemzo + */ + +#ifndef _DT_BINDINGS_RST_ALLWINNER_SUN8I_V85X_CCU_H_ +#define _DT_BINDINGS_RST_ALLWINNER_SUN8I_V85X_CCU_H_ + +#define RST_MBUS 0 +#define RST_BUS_DE 1 +#define RST_BUS_G2D 2 +#define RST_BUS_CE 3 +#define RST_BUS_VE 4 +#define RST_BUS_NPU 5 +#define RST_BUS_DMA 6 +#define RST_BUS_MSGBOX0 7 +#define RST_BUS_MSGBOX1 8 +#define RST_BUS_SPINLOCK 9 +#define RST_BUS_HSTIMER 10 +#define RST_BUS_DBG 11 +#define RST_BUS_PWM 12 +#define RST_BUS_DRAM 13 +#define RST_BUS_MMC0 14 +#define RST_BUS_MMC1 15 +#define RST_BUS_MMC2 16 +#define RST_BUS_UART0 17 +#define RST_BUS_UART1 18 +#define RST_BUS_UART2 19 +#define RST_BUS_UART3 20 +#define RST_BUS_I2C0 21 +#define RST_BUS_I2C1 22 +#define RST_BUS_I2C2 23 +#define RST_BUS_I2C3 24 +#define RST_BUS_I2C4 25 +#define RST_BUS_SPI0 26 +#define RST_BUS_SPI1 27 +#define RST_BUS_SPI2 28 +#define RST_BUS_SPI3 29 +#define RST_BUS_SPIF 30 +#define RST_BUS_EMAC 31 +#define RST_BUS_GPADC 32 +#define RST_BUS_THS 33 +#define RST_BUS_I2S0 34 +#define RST_BUS_I2S1 35 +#define RST_BUS_DMIC 36 +#define RST_BUS_AUDIO_CODEC 37 +#define RST_USB_PHY 38 +#define RST_BUS_OHCI 39 +#define RST_BUS_EHCI 40 +#define RST_BUS_OTG 41 +#define RST_BUS_DPSS_TOP 42 +#define RST_BUS_MIPI_DSI 43 +#define RST_BUS_TCON_LCD 44 +#define RST_BUS_CSI 45 +#define RST_BUS_WIEGAND 46 +#define RST_RISCV_SYS_APB 47 +#define RST_RISCV_SOFT 48 +#define RST_RISCV_CFG 49 + +#endif diff --git a/include/dt-bindings/reset/allwinner,sun8i-v853-r-ccu.h b/include/dt-bindings/reset/allwinner,sun8i-v853-r-ccu.h new file mode 100644 index 000000000000..57629d635115 --- /dev/null +++ b/include/dt-bindings/reset/allwinner,sun8i-v853-r-ccu.h @@ -0,0 +1,14 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Copyright (C) 2025 Andras Szemzo + */ + +#ifndef _DT_BINDINGS_RST_ALLWINNER_SUN8I_V853_R_CCU_H_ +#define _DT_BINDINGS_RST_ALLWINNER_SUN8I_V853_R_CCU_H_ + +#define RST_BUS_R_TWD 0 +#define RST_BUS_R_PPU 1 +#define RST_BUS_R_RTC 2 +#define RST_BUS_R_CPUCFG 3 + +#endif From patchwork Wed Feb 5 12:52:19 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andras Szemzo X-Patchwork-Id: 13961000 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 969E6C02192 for ; Wed, 5 Feb 2025 13:02:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=aIdThty3gj0JI55is1X+wCdIhLw0G+fhH0QncAjVbnw=; b=1a4WN48n4+0TdiIl887Zij1UeT aCDJNpE/xFufCqcYZkl+kumYynVuplB+4Tli1TbpHYbt8CU4FF+1HCzX+xRB4sjmYR5mLmo3aunUU YZtpf9xBo7YRvPM/Yvt4ntYtS5BA7KSrVbghpvPD1Pu/OWttlr1sLm5L5pdnikfyppxk9/G6OriKS wz5aYbMczIuVEpMfFELN6vOI4UqKdlnRfqSiVMEREhKL7G2r4ec0mue84Q46Aw5QRfuYJveEiVGTT c3/YhJX1QIvB2MaxfcnWehl2X7Z+RQXUau5R4g0VvhMHCNXFrNDf3I89uNhQoEq0Dln3NCYrk+I0P f+VREYBQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tff2v-00000003KDr-3biW; Wed, 05 Feb 2025 13:02:25 +0000 Received: from mail-ed1-x534.google.com ([2a00:1450:4864:20::534]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tfetR-00000003HqI-33Qk; Wed, 05 Feb 2025 12:52:39 +0000 Received: by mail-ed1-x534.google.com with SMTP id 4fb4d7f45d1cf-5d96944401dso11095397a12.0; Wed, 05 Feb 2025 04:52:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1738759956; x=1739364756; darn=lists.infradead.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=aIdThty3gj0JI55is1X+wCdIhLw0G+fhH0QncAjVbnw=; b=kHBsy4rvmC+gnRLfVMbGf69eAfKiEb2fWy2snkplYwvfufqYDGU4XstGiJlAPQVoJT NE2V6Q6hbSB02tjAwfB2MbsoLXw8ZAfPMB6uppraqrQiit1CT8yx/y48CDgWZhkXcGkF tawVQEzzK7uUIq7mdh5R/KavSVKh+CHvH/qnaZj9FdATO7CZicHRuPxM+/t+qhsFaw1+ iyhKGjDUg3peQGoM9GT1ZG3oiC+hwJZiotxK+pA+MIwA+Uv5+FQGJHcETSPg1RWO6ySO NYURb/MCjKgycsSBAc3L242d5vMegt4ns709kGqIWhpxef0kgsEuwj9BqMTVtubrsqnh HThQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738759956; x=1739364756; 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=aIdThty3gj0JI55is1X+wCdIhLw0G+fhH0QncAjVbnw=; b=OXYescfmLjXRNE6pve+6iaV1ierf1pyMREUVjsO2Bvd4UySnulOZ9i9PZAfi7ceue3 p6dT1N6UM+43rscsp6ToWXJ0mADrvDqa9zuuyy7W6C/zzp5eSU5KAXewxNsP+mEQCRTT i5Z7u0+2QCOuKbpAufGCoAPil6mjeRshiOIgTUkzKgU/KdCrtCrUDO7zV171pamgfMXY MdWt2zacpkQyC6BSSi5ZXAegOErYAJdbRPlM20r67FJJpoqs4y8RowR2eB7HX7qfidFf jOi2J9qwi+mZ9R16bXzaVaXRhO+w9zVG256+FokqzQ4f6965qMZMozpNmWrPBg512Tqt 8Dfw== X-Forwarded-Encrypted: i=1; AJvYcCU9gyvRf6myeahmLyDDe1uSYpznznZl/iC00HJlto9gqabsW//xV0Kmy2SU6bqzMLlST6bcH3ivFUYhOIyqAeVa@lists.infradead.org, AJvYcCVeOxF/E1zrJVzhZlMTDMT8Egbe/X7S0SUY+6UX0bTnru328z2bIFT32YTEp8d5cvbQK+wj++oU3eTX@lists.infradead.org, AJvYcCXiKnzxEV+w3959QMG/pK7z5+LvjBUjHTHMLTxXo0/aV1UYhhc7JVxomTKAUFkMtUZ+GDdsHwAToX1vmjc=@lists.infradead.org X-Gm-Message-State: AOJu0Ywc4fQiwa+xRnZp9nnE+7s93kuMm5Im+bxcheUcRi6TjHuNcuJL qRrAldqjxaT2NSdL7ga9iuEW1PTyzbPy7/cOi0pwycuGF8y6h8de X-Gm-Gg: ASbGncvS2ifwRt5bP8B7hvZLTfMkzzDktttzmmYZR7f5qcHQTnB+HkQuktmaT7j/Cuy Hn98eU9Q41uZ+bKvtu3ob2mc+EI+o36Cm4MTWKgIiCcTGJGf71nWxQKXjMjTLtRCCmOxh1lVtSw 9AChWV6pWZNP5izmb30IOXJ2gVGAg/lOAqTLdGL55eUydaT3TSeuYGzUGP6VfGtIeFD+5WLmhrr H1SbpmlG8283scU7Z85ghYRIbrCNwfzEiPdeP1qio3Iu1s8jVbuALh65FdvergcGdd989vsVz42 rLqfTgQZ3luY2CsxFoNtTeLIiBu46oaC1+dIlc7es7o/vw== X-Google-Smtp-Source: AGHT+IFMoHm7hY16+Yov0P07kFTKzlnnspfAg4eEypr2ER9UMUWc9YZtiBnM7rooQHcncGhAk5M3sg== X-Received: by 2002:a05:6402:4017:b0:5d9:a54:f8b4 with SMTP id 4fb4d7f45d1cf-5dcdb7129fbmr3623608a12.11.1738759955547; Wed, 05 Feb 2025 04:52:35 -0800 (PST) Received: from localhost.localdomain (185.174.17.62.zt.hu. [185.174.17.62]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5dc724055e5sm11559997a12.45.2025.02.05.04.52.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Feb 2025 04:52:35 -0800 (PST) From: Andras Szemzo To: Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Linus Walleij , Philipp Zabel , Maxime Ripard Cc: Vinod Koul , Kishon Vijay Abraham I , Ulf Hansson , Paul Walmsley , Palmer Dabbelt , Albert Ou , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Florian Fainelli , linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, linux-gpio@vger.kernel.org, linux-pm@vger.kernel.org, linux-riscv@lists.infradead.org Subject: [PATCH v2 04/10] clk: sunxi-ng: add CCU drivers for V853 Date: Wed, 5 Feb 2025 13:52:19 +0100 Message-Id: <20250205125225.1152849-5-szemzo.andras@gmail.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250205125225.1152849-1-szemzo.andras@gmail.com> References: <20250205125225.1152849-1-szemzo.andras@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250205_045237_781173_AD69FEB0 X-CRM114-Status: GOOD ( 22.02 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org V853 has similar gates/resets like existing Allwinner SOCs. Add support for it's CCU and PRCM CCU. Signed-off-by: Andras Szemzo --- drivers/clk/sunxi-ng/Kconfig | 10 + drivers/clk/sunxi-ng/Makefile | 4 + drivers/clk/sunxi-ng/ccu-sun8i-v853-r.c | 120 +++ drivers/clk/sunxi-ng/ccu-sun8i-v853-r.h | 14 + drivers/clk/sunxi-ng/ccu-sun8i-v853.c | 1145 +++++++++++++++++++++++ drivers/clk/sunxi-ng/ccu-sun8i-v853.h | 14 + 6 files changed, 1307 insertions(+) create mode 100644 drivers/clk/sunxi-ng/ccu-sun8i-v853-r.c create mode 100644 drivers/clk/sunxi-ng/ccu-sun8i-v853-r.h create mode 100644 drivers/clk/sunxi-ng/ccu-sun8i-v853.c create mode 100644 drivers/clk/sunxi-ng/ccu-sun8i-v853.h diff --git a/drivers/clk/sunxi-ng/Kconfig b/drivers/clk/sunxi-ng/Kconfig index b547198a2c65..e257373177e0 100644 --- a/drivers/clk/sunxi-ng/Kconfig +++ b/drivers/clk/sunxi-ng/Kconfig @@ -12,6 +12,16 @@ config SUNIV_F1C100S_CCU default y depends on MACH_SUNIV || COMPILE_TEST +config SUN8I_V853_CCU + tristate "Support for the Allwinner V853/V851s/V851SE CCU" + default MACH_SUN8I + depends on MACH_SUN8I || COMPILE_TEST + +config SUN8I_V853_R_CCU + tristate "Support for the Allwinner V853/V851s/V851SE PRCM CCU" + default MACH_SUN8I + depends on MACH_SUN8I || COMPILE_TEST + config SUN20I_D1_CCU tristate "Support for the Allwinner D1/R528/T113 CCU" default y diff --git a/drivers/clk/sunxi-ng/Makefile b/drivers/clk/sunxi-ng/Makefile index 6b3ae2b620db..b87928462e15 100644 --- a/drivers/clk/sunxi-ng/Makefile +++ b/drivers/clk/sunxi-ng/Makefile @@ -25,6 +25,8 @@ sunxi-ccu-y += ccu_mp.o # SoC support obj-$(CONFIG_SUNIV_F1C100S_CCU) += suniv-f1c100s-ccu.o +obj-$(CONFIG_SUN8I_V853_CCU) += sun8i-v853-ccu.o +obj-$(CONFIG_SUN8I_V853_R_CCU) += sun8i-v853-r-ccu.o obj-$(CONFIG_SUN20I_D1_CCU) += sun20i-d1-ccu.o obj-$(CONFIG_SUN20I_D1_R_CCU) += sun20i-d1-r-ccu.o obj-$(CONFIG_SUN50I_A64_CCU) += sun50i-a64-ccu.o @@ -50,6 +52,8 @@ obj-$(CONFIG_SUN9I_A80_CCU) += sun9i-a80-de-ccu.o obj-$(CONFIG_SUN9I_A80_CCU) += sun9i-a80-usb-ccu.o suniv-f1c100s-ccu-y += ccu-suniv-f1c100s.o +sun8i-v853-ccu-y += ccu-sun8i-v853.o +sun8i-v853-r-ccu-y += ccu-sun8i-v853-r.o sun20i-d1-ccu-y += ccu-sun20i-d1.o sun20i-d1-r-ccu-y += ccu-sun20i-d1-r.o sun50i-a64-ccu-y += ccu-sun50i-a64.o diff --git a/drivers/clk/sunxi-ng/ccu-sun8i-v853-r.c b/drivers/clk/sunxi-ng/ccu-sun8i-v853-r.c new file mode 100644 index 000000000000..bd60e00cda7f --- /dev/null +++ b/drivers/clk/sunxi-ng/ccu-sun8i-v853-r.c @@ -0,0 +1,120 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2025 Andras Szemzo + * + * Based on ccu-sun20i-d1-r.c by Samuel Holland. + */ + +#include +#include +#include + +#include "ccu_common.h" +#include "ccu_reset.h" + +#include "ccu_gate.h" +#include "ccu_mp.h" + +#include "ccu-sun8i-v853-r.h" + +static const struct clk_parent_data r_ahb_apb0_parents[] = { + { .fw_name = "hosc" }, + { .fw_name = "losc" }, + { .fw_name = "iosc" }, + { .fw_name = "pll-periph" }, + { .fw_name = "pll-audio" } +}; + +static SUNXI_CCU_MP_DATA_WITH_MUX(r_ahb_clk, "r-ahb", + r_ahb_apb0_parents, 0x000, + 0, 5, /* M */ + 8, 2, /* P */ + 24, 3, /* mux */ + 0); +static const struct clk_hw *r_ahb_hw = &r_ahb_clk.common.hw; + +static SUNXI_CCU_MP_DATA_WITH_MUX(r_apb0_clk, "r-apb0", + r_ahb_apb0_parents, 0x00c, + 0, 5, /* M */ + 8, 2, /* P */ + 24, 3, /* mux */ + 0); +static const struct clk_hw *r_apb0_hw = &r_apb0_clk.common.hw; + +static SUNXI_CCU_GATE_HWS(bus_r_twd_clk, "bus-r-twd", &r_apb0_hw, + 0x12c, BIT(0), 0); +static SUNXI_CCU_GATE_HWS(bus_r_ppu_clk, "bus-r-ppu", &r_apb0_hw, + 0x1ac, BIT(0), 0); +static SUNXI_CCU_GATE_HWS(bus_r_rtc_clk, "bus-r-rtc", &r_ahb_hw, + 0x20c, BIT(0), 0); +static SUNXI_CCU_GATE_HWS(bus_r_cpucfg_clk, "bus-r-cpucfg", &r_apb0_hw, + 0x22c, BIT(0), 0); + +static struct ccu_common *sun8i_v853_r_ccu_clks[] = { + &r_ahb_clk.common, + &r_apb0_clk.common, + &bus_r_twd_clk.common, + &bus_r_ppu_clk.common, + &bus_r_rtc_clk.common, + &bus_r_cpucfg_clk.common, +}; + +static struct clk_hw_onecell_data sun8i_v853_r_hw_clks = { + .num = CLK_NUMBER, + .hws = { + [CLK_R_AHB] = &r_ahb_clk.common.hw, + [CLK_R_APB0] = &r_apb0_clk.common.hw, + [CLK_BUS_R_TWD] = &bus_r_twd_clk.common.hw, + [CLK_BUS_R_PPU] = &bus_r_ppu_clk.common.hw, + [CLK_BUS_R_RTC] = &bus_r_rtc_clk.common.hw, + [CLK_BUS_R_CPUCFG] = &bus_r_cpucfg_clk.common.hw, + }, +}; + +static const struct ccu_reset_map sun8i_v853_r_ccu_resets[] = { + [RST_BUS_R_TWD] = { 0x12c, BIT(16) }, + [RST_BUS_R_PPU] = { 0x1ac, BIT(16) }, + [RST_BUS_R_RTC] = { 0x20c, BIT(16) }, + [RST_BUS_R_CPUCFG] = { 0x22c, BIT(16) }, +}; + +static const struct sunxi_ccu_desc sun8i_v853_r_ccu_desc = { + .ccu_clks = sun8i_v853_r_ccu_clks, + .num_ccu_clks = ARRAY_SIZE(sun8i_v853_r_ccu_clks), + + .hw_clks = &sun8i_v853_r_hw_clks, + + .resets = sun8i_v853_r_ccu_resets, + .num_resets = ARRAY_SIZE(sun8i_v853_r_ccu_resets), +}; + +static int sun8i_v853_r_ccu_probe(struct platform_device *pdev) +{ + void __iomem *reg; + + reg = devm_platform_ioremap_resource(pdev, 0); + if (IS_ERR(reg)) + return PTR_ERR(reg); + + return devm_sunxi_ccu_probe(&pdev->dev, reg, &sun8i_v853_r_ccu_desc); +} + +static const struct of_device_id sun8i_v853_r_ccu_ids[] = { + { .compatible = "allwinner,sun8i-v853-r-ccu" }, + { } +}; +MODULE_DEVICE_TABLE(of, sun8i_v853_r_ccu_ids); + +static struct platform_driver sun8i_v853_r_ccu_driver = { + .probe = sun8i_v853_r_ccu_probe, + .driver = { + .name = "sun8i-v853-r-ccu", + .suppress_bind_attrs = true, + .of_match_table = sun8i_v853_r_ccu_ids, + }, +}; +module_platform_driver(sun8i_v853_r_ccu_driver); + +MODULE_IMPORT_NS("SUNXI_CCU"); +MODULE_DESCRIPTION("Support for the Allwinner V853 PRCM CCU"); +MODULE_LICENSE("GPL"); diff --git a/drivers/clk/sunxi-ng/ccu-sun8i-v853-r.h b/drivers/clk/sunxi-ng/ccu-sun8i-v853-r.h new file mode 100644 index 000000000000..2c6cc7b6f251 --- /dev/null +++ b/drivers/clk/sunxi-ng/ccu-sun8i-v853-r.h @@ -0,0 +1,14 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Copyright (C) 2025 Andras Szemzo + */ + +#ifndef _CCU_SUN8I_V853_R_H +#define _CCU_SUN8I_V853_R_H + +#include +#include + +#define CLK_NUMBER (CLK_BUS_R_CPUCFG + 1) + +#endif diff --git a/drivers/clk/sunxi-ng/ccu-sun8i-v853.c b/drivers/clk/sunxi-ng/ccu-sun8i-v853.c new file mode 100644 index 000000000000..4b32f3a913cf --- /dev/null +++ b/drivers/clk/sunxi-ng/ccu-sun8i-v853.c @@ -0,0 +1,1145 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2025 Andras Szemzo + * + * Based on ccu-sun20i-d1.c by Samuel Holland. + */ + +#include +#include +#include +#include + +#include "../clk.h" + +#include "ccu_common.h" +#include "ccu_reset.h" + +#include "ccu_div.h" +#include "ccu_gate.h" +#include "ccu_mp.h" +#include "ccu_mult.h" +#include "ccu_nk.h" +#include "ccu_nkm.h" +#include "ccu_nkmp.h" +#include "ccu_nm.h" + +#include "ccu-sun8i-v853.h" + +static const struct clk_parent_data osc24M[] = { + { .fw_name = "hosc" } +}; + +/* + * For the CPU PLL, the output divider is described as "only for testing" + * in the user manual. So it's not modelled and forced to 0. + */ +#define SUN8I_V853_PLL_CPU_REG 0x000 + +static struct ccu_mult pll_cpu_clk = { + .enable = BIT(27), + .lock = BIT(28), + .mult = _SUNXI_CCU_MULT_MIN(8, 8, 11), + .common = { + .reg = 0x000, + .hw.init = CLK_HW_INIT_PARENTS_DATA("pll-cpu", osc24M, + &ccu_mult_ops, + CLK_SET_RATE_GATE), + }, +}; + +/* Some PLLs are input * N / div1 / P. Model them as NKMP with no K */ +#define SUN8I_V853_PLL_DDR_REG 0x010 +static struct ccu_nkmp pll_ddr_clk = { + .enable = BIT(27), + .lock = BIT(28), + .n = _SUNXI_CCU_MULT_MIN(8, 8, 11), + .m = _SUNXI_CCU_DIV(1, 1), /* input divider */ + .p = _SUNXI_CCU_DIV(0, 1), /* output divider */ + .common = { + .reg = 0x010, + .hw.init = CLK_HW_INIT_PARENTS_DATA("pll-ddr", osc24M, + &ccu_nkmp_ops, + CLK_SET_RATE_GATE), + }, +}; + +#define SUN8I_V853_PLL_PERIPH_REG 0x020 +static struct ccu_nm pll_periph_4x_clk = { + .enable = BIT(27), + .lock = BIT(28), + .n = _SUNXI_CCU_MULT_MIN(8, 8, 11), + .m = _SUNXI_CCU_DIV(1, 1), /* input divider */ + .common = { + .reg = 0x020, + .hw.init = CLK_HW_INIT_PARENTS_DATA("pll-periph-4x", osc24M, + &ccu_nm_ops, + CLK_SET_RATE_GATE), + }, +}; + +static const struct clk_hw *pll_periph_4x_hws[] = { + &pll_periph_4x_clk.common.hw +}; + +static SUNXI_CCU_M_HWS(pll_periph_2x_clk, "pll-periph-2x", pll_periph_4x_hws, + 0x020, 16, 3, 0); + +static SUNXI_CCU_M_HWS(pll_periph_800M_clk, "pll-periph-800M", pll_periph_4x_hws, + 0x020, 20, 3, 0); + +static SUNXI_CCU_M_HWS(pll_periph_480M_clk, "pll-periph-480M", pll_periph_4x_hws, + 0x020, 2, 3, 0); + +static CLK_FIXED_FACTOR_HW(pll_periph_600M_clk, "pll-periph-600M", + &pll_periph_2x_clk.common.hw, 2, 1, 0); + +static CLK_FIXED_FACTOR_HW(pll_periph_400M_clk, "pll-periph-400M", + &pll_periph_2x_clk.common.hw, 3, 1, 0); + +static CLK_FIXED_FACTOR_HW(pll_periph_300M_clk, "pll-periph-300M", + &pll_periph_600M_clk.hw, 2, 1, 0); + +static CLK_FIXED_FACTOR_HW(pll_periph_200M_clk, "pll-periph-200M", + &pll_periph_400M_clk.hw, 2, 1, 0); + +static CLK_FIXED_FACTOR_HW(pll_periph_160M_clk, "pll-periph-160M", + &pll_periph_480M_clk.common.hw, 3, 1, 0); + +static CLK_FIXED_FACTOR_HW(pll_periph_150M_clk, "pll-periph-150M", + &pll_periph_300M_clk.hw, 2, 1, 0); + +/* + * For Video PLLs, the output divider is described as "only for testing" + * in the user manual. + */ +#define SUN8I_V853_PLL_VIDEO_REG 0x040 +static struct ccu_nkmp pll_video_4x_clk = { + .enable = BIT(27), + .lock = BIT(28), + .n = _SUNXI_CCU_MULT_MIN(8, 8, 11), + .p = _SUNXI_CCU_DIV(1, 1), /* input divider */ + .common = { + .reg = 0x040, + .hw.init = CLK_HW_INIT_PARENTS_DATA("pll-video-4x", osc24M, + &ccu_nkmp_ops, + CLK_SET_RATE_GATE), + }, +}; + +static const struct clk_hw *pll_video_4x_hws[] = { + &pll_video_4x_clk.common.hw +}; +static CLK_FIXED_FACTOR_HWS(pll_video_2x_clk, "pll-video-2x", + pll_video_4x_hws, 2, 1, CLK_SET_RATE_PARENT); +static CLK_FIXED_FACTOR_HWS(pll_video_1x_clk, "pll-video-1x", + pll_video_4x_hws, 4, 1, CLK_SET_RATE_PARENT); + + +/* + * For CSI PLLs, the output divider is described as "only for testing" + * in the user manual. + */ +#define SUN8I_V853_PLL_CSI_REG 0x048 +static struct ccu_nkmp pll_csi_4x_clk = { + .enable = BIT(27), + .lock = BIT(28), + .n = _SUNXI_CCU_MULT_MIN(8, 8, 11), + .p = _SUNXI_CCU_DIV(1, 1), /* input divider */ + .common = { + .reg = 0x048, + .hw.init = CLK_HW_INIT_PARENTS_DATA("pll-csi-4x", osc24M, + &ccu_nkmp_ops, + CLK_SET_RATE_GATE), + }, +}; + +static CLK_FIXED_FACTOR_HW(pll_csi_clk, "pll-csi", + &pll_csi_4x_clk.common.hw, 4, 1, CLK_SET_RATE_PARENT); + + +#define SUN8I_V853_PLL_AUDIO_REG 0x078 +static struct ccu_sdm_setting pll_audio_div5_sdm_table[] = { + { .rate = 196608000, .pattern = 0xc001eb85, .m = 5, .n = 40 }, /* 24.576 */ + { .rate = 67737600, .pattern = 0xc001288d, .m = 8, .n = 22 }, /* 22.5792 */ +}; + +static struct ccu_nm pll_audio_div5_clk = { + .enable = BIT(27), + .lock = BIT(28), + .n = _SUNXI_CCU_MULT(8, 8), + .m = _SUNXI_CCU_DIV(20, 3), + .sdm = _SUNXI_CCU_SDM(pll_audio_div5_sdm_table, + BIT(24), 0x0178, BIT(31)), + .common = { + .reg = 0x0078, + .features = CCU_FEATURE_SIGMA_DELTA_MOD, + .hw.init = CLK_HW_INIT_PARENTS_DATA("pll-audio-div5", osc24M, + &ccu_nm_ops, + CLK_SET_RATE_UNGATE), + }, +}; + +static const struct clk_hw *pll_audio_div5_hws[] = { + &pll_audio_div5_clk.common.hw +}; + +static SUNXI_CCU_M_HWS(pll_audio_1x_clk, "pll-audio-1x", pll_audio_div5_hws, + 0xe00, 0, 5, CLK_SET_RATE_PARENT); + +/* pll-audio-div2 and pll-audio-4x not used, because pll-audio-1x can cover + * 22.5792M and 24.576M + */ +static SUNXI_CCU_M(pll_audio_div2_clk, "pll-audio-div2", "pll-audio", + 0x078, 16, 3, 0); +static SUNXI_CCU_M(pll_audio_4x_clk, "pll-audio-4x", "pll-audio-div2", + 0xe00, 5, 5, 0); + +/* + * For the NPU PLL, the output divider is described as "only for testing" + * in the user manual. + */ +#define SUN8I_V853_PLL_NPU_REG 0x080 +static struct ccu_nkmp pll_npu_4x_clk = { + .enable = BIT(27), + .lock = BIT(28), + .n = _SUNXI_CCU_MULT_MIN(8, 8, 11), + .p = _SUNXI_CCU_DIV(1, 1), /* input divider */ + .common = { + .reg = 0x080, + .hw.init = CLK_HW_INIT_PARENTS_DATA("pll-npu-4x", osc24M, + &ccu_nkmp_ops, + CLK_SET_RATE_UNGATE), + }, +}; + +/* + * The CPU gate is not modelled - it is in a separate register (0x504) + * and has a special key field. The clock must not be gated anyway by + * the kernel. + */ +static const struct clk_parent_data cpu_parents[] = { + { .fw_name = "hosc" }, + { .fw_name = "losc" }, + { .fw_name = "iosc" }, + { .hw = &pll_cpu_clk.common.hw }, + { .hw = &pll_periph_600M_clk.hw }, + { .hw = &pll_periph_800M_clk.common.hw }, +}; + +/* + * There is a P factor (PLL_OUT_EXT_DIVP[17:16]) in this register, but it is not modeled. + * The manual states that it should be used only, when the output clock is less than 288 MHz. + */ +static SUNXI_CCU_MUX_DATA(cpu_clk, "cpu", cpu_parents, + 0x500, 24, 3, CLK_SET_RATE_PARENT | CLK_IS_CRITICAL); + +static const struct clk_hw *cpu_hws[] = { &cpu_clk.common.hw }; + +static SUNXI_CCU_M_HWS(cpu_axi_clk, "cpu-axi", cpu_hws, + 0x500, 0, 2, 0); +static SUNXI_CCU_M_HWS(cpu_apb_clk, "cpu-apb", cpu_hws, + 0x500, 8, 2, 0); + +static const struct clk_parent_data ahb_parents[] = { + { .fw_name = "hosc" }, + { .fw_name = "losc" }, + { .fw_name = "iosc" }, + { .hw = &pll_periph_600M_clk.hw }, +}; +static SUNXI_CCU_MP_DATA_WITH_MUX(ahb_clk, "ahb", ahb_parents, 0x510, + 0, 5, /* M */ + 8, 2, /* P */ + 24, 2, /* mux */ + 0); + +static SUNXI_CCU_MP_DATA_WITH_MUX(apb0_clk, "apb0", ahb_parents, 0x520, + 0, 5, /* M */ + 8, 2, /* P */ + 24, 2, /* mux */ + 0); + +static SUNXI_CCU_MP_DATA_WITH_MUX(apb1_clk, "apb1", ahb_parents, 0x524, + 0, 5, /* M */ + 8, 2, /* P */ + 24, 2, /* mux */ + 0); + +static const struct clk_hw *ahb_hws[] = { &ahb_clk.common.hw }; +static const struct clk_hw *apb0_hws[] = { &apb0_clk.common.hw }; +static const struct clk_hw *apb1_hws[] = { &apb1_clk.common.hw }; + + +static const struct clk_hw *de_g2d_parents[] = { + &pll_periph_300M_clk.hw, + &pll_video_1x_clk.hw, +}; +static SUNXI_CCU_M_HW_WITH_MUX_GATE(de_clk, "de", de_g2d_parents, 0x600, + 0, 5, /* M */ + 24, 1, /* mux */ + BIT(31), /* gate */ + CLK_SET_RATE_PARENT); + +static SUNXI_CCU_GATE_HWS(bus_de_clk, "bus-de", ahb_hws, + 0x60c, BIT(0), 0); + +static SUNXI_CCU_M_HW_WITH_MUX_GATE(g2d_clk, "g2d", de_g2d_parents, 0x630, + 0, 5, /* M */ + 24, 1, /* mux */ + BIT(31), /* gate */ + CLK_SET_RATE_PARENT); + +static SUNXI_CCU_GATE_HWS(bus_g2d_clk, "bus-g2d", ahb_hws, + 0x63c, BIT(0), 0); + + +static const struct clk_parent_data ce_parents[] = { + { .fw_name = "hosc" }, + { .hw = &pll_periph_400M_clk.hw, }, + { .hw = &pll_periph_300M_clk.hw, } +}; +static SUNXI_CCU_M_DATA_WITH_MUX_GATE(ce_clk, "ce", ce_parents, 0x680, + 0, 4, /* M */ + 24, 3, /* mux */ + BIT(31), /* gate */ + CLK_SET_RATE_PARENT); + +static SUNXI_CCU_GATE_HWS(bus_ce_clk, "bus-ce", ahb_hws, + 0x68c, BIT(0) | BIT(1), 0); + +static const struct clk_hw *ve_parents[] = { + &pll_periph_300M_clk.hw, + &pll_periph_400M_clk.hw, + &pll_periph_480M_clk.common.hw, + &pll_npu_4x_clk.common.hw, + &pll_video_4x_clk.common.hw, + &pll_csi_4x_clk.common.hw, +}; +static SUNXI_CCU_M_HW_WITH_MUX_GATE(ve_clk, "ve", ve_parents, 0x690, + 0, 5, /* M */ + 24, 3, /* mux */ + BIT(31), /* gate */ + 0); + +static SUNXI_CCU_GATE_HWS(bus_ve_clk, "bus-ve", ahb_hws, + 0x69c, BIT(0), 0); + + +static const struct clk_hw *npu_parents[] = { + &pll_periph_480M_clk.common.hw, + &pll_periph_600M_clk.hw, + &pll_periph_800M_clk.common.hw, + &pll_npu_4x_clk.common.hw, +}; +static SUNXI_CCU_M_HW_WITH_MUX_GATE(npu_clk, "npu", npu_parents, 0x6e0, + 0, 5, /* M */ + 24, 3, /* mux */ + BIT(31), /* gate */ + 0); + +static SUNXI_CCU_GATE_HWS(bus_npu_clk, "bus-npu", ahb_hws, + 0x6ec, BIT(0), 0); + +static SUNXI_CCU_GATE_HWS(bus_dma_clk, "bus-dma", ahb_hws, + 0x70c, BIT(0), 0); + +static SUNXI_CCU_GATE_HWS(bus_msgbox0_clk, "bus-msgbox0", ahb_hws, + 0x71c, BIT(0), 0); +static SUNXI_CCU_GATE_HWS(bus_msgbox1_clk, "bus-msgbox1", ahb_hws, + 0x71c, BIT(1), 0); + +static SUNXI_CCU_GATE_HWS(bus_spinlock_clk, "bus-spinlock", ahb_hws, + 0x72c, BIT(0), 0); + +static SUNXI_CCU_GATE_HWS(bus_hstimer_clk, "bus-hstimer", ahb_hws, + 0x73c, BIT(0), 0); + +static SUNXI_CCU_GATE_DATA(avs_clk, "avs", osc24M, + 0x740, BIT(31), 0); + +static SUNXI_CCU_GATE_HWS(bus_dbg_clk, "bus-dbg", ahb_hws, + 0x78c, BIT(0), 0); + +static SUNXI_CCU_GATE_HWS(bus_pwm_clk, "bus-pwm", apb0_hws, + 0x7ac, BIT(0), 0); + +static SUNXI_CCU_GATE_HWS(bus_iommu_clk, "bus-iommu", ahb_hws, + 0x7bc, BIT(0), 0); + +static const struct clk_hw *dram_parents[] = { + &pll_ddr_clk.common.hw, + &pll_periph_2x_clk.common.hw, + &pll_periph_800M_clk.common.hw, +}; +static SUNXI_CCU_MP_HW_WITH_MUX_GATE(dram_clk, "dram", dram_parents, 0x800, + 0, 5, /* M */ + 8, 2, /* P */ + 24, 3, /* mux */ + BIT(31), CLK_IS_CRITICAL); + +static CLK_FIXED_FACTOR_HW(mbus_clk, "mbus", + &dram_clk.common.hw, 4, 1, 0); + +static const struct clk_hw *mbus_hws[] = { &mbus_clk.hw }; + +static SUNXI_CCU_GATE_HWS(mbus_dma_clk, "mbus-dma", mbus_hws, + 0x804, BIT(0), 0); +static SUNXI_CCU_GATE_HWS(mbus_ve_clk, "mbus-ve", mbus_hws, + 0x804, BIT(1), 0); +static SUNXI_CCU_GATE_HWS(mbus_ce_clk, "mbus-ce", mbus_hws, + 0x804, BIT(2), 0); +static SUNXI_CCU_GATE_HWS(mbus_csi_clk, "mbus-csi", mbus_hws, + 0x804, BIT(8), 0); +static SUNXI_CCU_GATE_HWS(mbus_isp_clk, "mbus-isp", mbus_hws, + 0x804, BIT(9), 0); +static SUNXI_CCU_GATE_HWS(mbus_g2d_clk, "mbus-g2d", mbus_hws, + 0x804, BIT(10), 0); + +static SUNXI_CCU_GATE_HWS(bus_dram_clk, "bus-dram", ahb_hws, + 0x80c, BIT(0), CLK_IS_CRITICAL); + + +static const struct clk_parent_data mmc0_mmc1_parents[] = { + { .fw_name = "hosc" }, + { .hw = &pll_periph_400M_clk.hw, }, + { .hw = &pll_periph_300M_clk.hw, }, +}; +static SUNXI_CCU_MP_DATA_WITH_MUX_GATE(mmc0_clk, "mmc0", mmc0_mmc1_parents, 0x830, + 0, 4, /* M */ + 8, 2, /* P */ + 24, 3, /* mux */ + BIT(31), /* gate */ + 0); + +static SUNXI_CCU_MP_DATA_WITH_MUX_GATE(mmc1_clk, "mmc1", mmc0_mmc1_parents, 0x834, + 0, 4, /* M */ + 8, 2, /* P */ + 24, 3, /* mux */ + BIT(31), /* gate */ + 0); + +static const struct clk_parent_data mmc2_parents[] = { + { .fw_name = "hosc" }, + { .hw = &pll_periph_600M_clk.hw, }, + { .hw = &pll_periph_400M_clk.hw, }, +}; +static SUNXI_CCU_MP_DATA_WITH_MUX_GATE(mmc2_clk, "mmc2", mmc2_parents, 0x838, + 0, 4, /* M */ + 8, 2, /* P */ + 24, 3, /* mux */ + BIT(31), /* gate */ + 0); + +static SUNXI_CCU_GATE_HWS(bus_mmc0_clk, "bus-mmc0", ahb_hws, + 0x84c, BIT(0), 0); +static SUNXI_CCU_GATE_HWS(bus_mmc1_clk, "bus-mmc1", ahb_hws, + 0x84c, BIT(1), 0); +static SUNXI_CCU_GATE_HWS(bus_mmc2_clk, "bus-mmc2", ahb_hws, + 0x84c, BIT(2), 0); + +static SUNXI_CCU_GATE_HWS(bus_uart0_clk, "bus-uart0", apb1_hws, + 0x90c, BIT(0), 0); +static SUNXI_CCU_GATE_HWS(bus_uart1_clk, "bus-uart1", apb1_hws, + 0x90c, BIT(1), 0); +static SUNXI_CCU_GATE_HWS(bus_uart2_clk, "bus-uart2", apb1_hws, + 0x90c, BIT(2), 0); +static SUNXI_CCU_GATE_HWS(bus_uart3_clk, "bus-uart3", apb1_hws, + 0x90c, BIT(3), 0); + +static SUNXI_CCU_GATE_HWS(bus_i2c0_clk, "bus-i2c0", apb1_hws, + 0x91c, BIT(0), 0); +static SUNXI_CCU_GATE_HWS(bus_i2c1_clk, "bus-i2c1", apb1_hws, + 0x91c, BIT(1), 0); +static SUNXI_CCU_GATE_HWS(bus_i2c2_clk, "bus-i2c2", apb1_hws, + 0x91c, BIT(2), 0); +static SUNXI_CCU_GATE_HWS(bus_i2c3_clk, "bus-i2c3", apb1_hws, + 0x91c, BIT(3), 0); +static SUNXI_CCU_GATE_HWS(bus_i2c4_clk, "bus-i2c4", apb1_hws, + 0x91c, BIT(4), 0); + +static const struct clk_parent_data spi_parents[] = { + { .fw_name = "hosc" }, + { .hw = &pll_periph_300M_clk.hw, }, + { .hw = &pll_periph_200M_clk.hw, }, +}; + +static SUNXI_CCU_MP_DATA_WITH_MUX_GATE(spi0_clk, "spi0", spi_parents, 0x940, + 0, 4, /* M */ + 8, 2, /* P */ + 24, 3, /* mux */ + BIT(31), /* gate */ + 0); + +static SUNXI_CCU_MP_DATA_WITH_MUX_GATE(spi1_clk, "spi1", spi_parents, 0x944, + 0, 4, /* M */ + 8, 2, /* P */ + 24, 3, /* mux */ + BIT(31), /* gate */ + 0); + +static SUNXI_CCU_MP_DATA_WITH_MUX_GATE(spi2_clk, "spi2", spi_parents, 0x948, + 0, 4, /* M */ + 8, 2, /* P */ + 24, 3, /* mux */ + BIT(31), /* gate */ + 0); + +static SUNXI_CCU_MP_DATA_WITH_MUX_GATE(spi3_clk, "spi3", spi_parents, 0x94c, + 0, 4, /* M */ + 8, 2, /* P */ + 24, 3, /* mux */ + BIT(31), /* gate */ + 0); + +static SUNXI_CCU_GATE_HWS(bus_spi0_clk, "bus-spi0", ahb_hws, + 0x96c, BIT(0), 0); +static SUNXI_CCU_GATE_HWS(bus_spi1_clk, "bus-spi1", ahb_hws, + 0x96c, BIT(1), 0); +static SUNXI_CCU_GATE_HWS(bus_spi2_clk, "bus-spi2", ahb_hws, + 0x96c, BIT(2), 0); +static SUNXI_CCU_GATE_HWS(bus_spi3_clk, "bus-spi3", ahb_hws, + 0x96c, BIT(3), 0); + + +static const struct clk_parent_data spif_parents[] = { + { .fw_name = "hosc" }, + { .hw = &pll_periph_400M_clk.hw, }, + { .hw = &pll_periph_300M_clk.hw, }, +}; + +static SUNXI_CCU_M_DATA_WITH_MUX_GATE(spif_clk, "spif", spif_parents, 0x0950, + 0, 4, /* M */ + 24, 3, /* mux */ + BIT(31), /* gate */ + CLK_SET_RATE_PARENT); + +static SUNXI_CCU_GATE_HWS(bus_spif_clk, "bus-spif", ahb_hws, + 0x096c, BIT(4), 0); + + +static const struct clk_hw *pll_periph_150M_hws[] = { &pll_periph_150M_clk.hw }; +static SUNXI_CCU_GATE_HWS_WITH_PREDIV(emac_25M_clk, "emac-25M", pll_periph_150M_hws, + 0x970, BIT(31) | BIT(30), 6, 0); + +static SUNXI_CCU_GATE_HWS(bus_emac_clk, "bus-emac", ahb_hws, + 0x97c, BIT(0), 0); + +static SUNXI_CCU_GATE_HWS(bus_gpadc_clk, "bus-gpadc", apb0_hws, + 0x9ec, BIT(0), 0); + +static SUNXI_CCU_GATE_HWS(bus_ths_clk, "bus-ths", ahb_hws, + 0x9fc, BIT(0), 0); + + +static const struct clk_hw *audio_parents[] = { + &pll_audio_1x_clk.common.hw, + &pll_audio_4x_clk.common.hw, +}; + +static SUNXI_CCU_M_HW_WITH_MUX_GATE(i2s0_clk, "i2s0", audio_parents, 0xa10, + 0, 4, /* M */ + 24, 1, /* mux */ + BIT(31), /* gate */ + CLK_SET_RATE_PARENT); + +static SUNXI_CCU_M_HW_WITH_MUX_GATE(i2s1_clk, "i2s1", audio_parents, 0xa14, + 0, 4, /* M */ + 24, 1, /* mux */ + BIT(31), /* gate */ + CLK_SET_RATE_PARENT); + +static SUNXI_CCU_GATE_HWS(bus_i2s0_clk, "bus-i2s0", ahb_hws, + 0xa20, BIT(0), 0); + +static SUNXI_CCU_GATE_HWS(bus_i2s1_clk, "bus-i2s1", ahb_hws, + 0xa20, BIT(1), 0); + +static SUNXI_CCU_M_HW_WITH_MUX_GATE(dmic_clk, "dmic", audio_parents, 0xa40, + 0, 4, /* M */ + 24, 1, /* mux */ + BIT(31), /* gate */ + CLK_SET_RATE_PARENT); + +static SUNXI_CCU_GATE_HWS(bus_dmic_clk, "bus-dmic", ahb_hws, + 0xa4c, BIT(0), 0); + +static SUNXI_CCU_M_HW_WITH_MUX_GATE(audio_codec_dac_clk, "audio-codec-dac", + audio_parents, 0xa50, + 0, 4, /* M */ + 24, 1, /* mux */ + BIT(31), /* gate */ + CLK_SET_RATE_PARENT); + +static SUNXI_CCU_M_HW_WITH_MUX_GATE(audio_codec_adc_clk, "audio-codec-adc", + audio_parents, 0xa54, + 0, 4, /* M */ + 24, 1, /* mux */ + BIT(31), /* gate */ + CLK_SET_RATE_PARENT); + +static SUNXI_CCU_GATE_HWS(bus_audio_codec_clk, "bus-audio-codec", apb0_hws, + 0xa5c, BIT(0), 0); + +/* + * There are OHCI 12M clock source selection bits for the USB 2.0 port. + * We will force them to 0 (12M divided from 48M). + */ +static CLK_FIXED_FACTOR_FW_NAME(osc12M_clk, "osc12M", "hosc", 2, 1, 0); + +#define SUN8I_V853_USB_CLK_REG 0xa70 + +static SUNXI_CCU_GATE(usb_ohci_clk, "usb", "osc12M", 0x0a70, BIT(31), 0); + +static SUNXI_CCU_GATE_HWS(bus_ohci_clk, "bus-ohci", ahb_hws, 0xa8c, BIT(0), 0); +static SUNXI_CCU_GATE_HWS(bus_ehci_clk, "bus-ehci", ahb_hws, 0xa8c, BIT(4), 0); +static SUNXI_CCU_GATE_HWS(bus_otg_clk, "bus-otg", ahb_hws, 0xa8c, BIT(8), 0); + +static SUNXI_CCU_GATE_HWS(bus_dpss_top_clk, "bus-dpss-top", ahb_hws, + 0xabc, BIT(0), 0); + + +static const struct clk_parent_data mipi_dsi_parents[] = { + { .fw_name = "hosc" }, + { .hw = &pll_periph_200M_clk.hw }, + { .hw = &pll_periph_150M_clk.hw }, +}; +static SUNXI_CCU_M_DATA_WITH_MUX_GATE(mipi_dsi_clk, "mipi-dsi", mipi_dsi_parents, + 0xb24, + 0, 4, /* M */ + 24, 3, /* mux */ + BIT(31), /* gate */ + CLK_SET_RATE_PARENT); + +static SUNXI_CCU_GATE_HWS(bus_mipi_dsi_clk, "bus-mipi-dsi", ahb_hws, + 0xb4c, BIT(0), 0); + + +static const struct clk_hw *tcon_lcd_parents[] = { + &pll_video_4x_clk.common.hw, + &pll_periph_2x_clk.common.hw, + &pll_csi_4x_clk.common.hw, +}; +static SUNXI_CCU_MP_HW_WITH_MUX_GATE(tcon_lcd_clk, "tcon-lcd", tcon_lcd_parents, + 0xb60, + 0, 4, /* M */ + 8, 2, /* P */ + 24, 3, /* mux */ + BIT(31), /* gate */ + CLK_SET_RATE_PARENT); + +static SUNXI_CCU_GATE_HWS(bus_tcon_lcd_clk, "bus-tcon-lcd", ahb_hws, + 0xb7c, BIT(0), 0); + + +static const struct clk_hw *csi_top_parents[] = { + &pll_periph_300M_clk.hw, + &pll_periph_400M_clk.hw, + &pll_video_4x_clk.common.hw, + &pll_csi_4x_clk.common.hw, +}; +static SUNXI_CCU_M_HW_WITH_MUX_GATE(csi_top_clk, "csi-top", csi_top_parents, 0xc04, + 0, 5, /* M */ + 24, 3, /* mux */ + BIT(31), /* gate */ + 0); + + +static const struct clk_parent_data csi_mclk_parents[] = { + { .fw_name = "hosc" }, + { .hw = &pll_csi_4x_clk.common.hw }, + { .hw = &pll_video_4x_clk.common.hw }, + { .hw = &pll_periph_2x_clk.common.hw }, +}; +static SUNXI_CCU_M_DATA_WITH_MUX_GATE(csi_mclk0_clk, "csi-mclk0", csi_mclk_parents, + 0xc08, + 0, 5, /* M */ + 24, 3, /* mux */ + BIT(31), /* gate */ + 0); + +static SUNXI_CCU_M_DATA_WITH_MUX_GATE(csi_mclk1_clk, "csi-mclk1", csi_mclk_parents, + 0xc0c, + 0, 5, /* M */ + 24, 3, /* mux */ + BIT(31), /* gate */ + 0); + +static SUNXI_CCU_M_DATA_WITH_MUX_GATE(csi_mclk2_clk, "csi-mclk2", csi_mclk_parents, + 0xc10, + 0, 5, /* M */ + 24, 3, /* mux */ + BIT(31), /* gate */ + 0); + +static SUNXI_CCU_GATE_HWS(bus_csi_clk, "bus-csi", ahb_hws, + 0xc2c, BIT(0), 0); + + +static SUNXI_CCU_GATE_HWS(bus_wiegand_clk, "bus-wiegand", ahb_hws, + 0xc7c, BIT(0), 0); + + +static const struct clk_parent_data riscv_parents[] = { + { .fw_name = "hosc" }, + { .fw_name = "losc" }, + { .fw_name = "iosc" }, + { .hw = &pll_periph_600M_clk.hw }, + { .hw = &pll_periph_480M_clk.common.hw }, + { .hw = &pll_cpu_clk.common.hw }, +}; +static SUNXI_CCU_M_DATA_WITH_MUX(riscv_clk, "riscv-cpu", riscv_parents, 0xd00, + 0, 5, /* M */ + 24, 3, /* mux */ + CLK_SET_RATE_PARENT); + +/* The riscv-axi clk must be divided by at least 2. */ +static struct clk_div_table riscv_axi_table[] = { + { .val = 1, .div = 2 }, + { .val = 2, .div = 3 }, + { .val = 3, .div = 4 }, + { /* Sentinel */ } +}; +static SUNXI_CCU_DIV_TABLE_HW(riscv_axi_clk, "riscv-axi", &riscv_clk.common.hw, + 0xd00, 8, 2, riscv_axi_table, 0); + +static SUNXI_CCU_GATE_HWS_WITH_KEY(riscv_core_gate, "riscv-core-gate", ahb_hws, + 0xd04, BIT(0), 0); + +static SUNXI_CCU_GATE_HWS(riscv_cfg_gate, "riscv-cfg-gate", ahb_hws, + 0xd0c, BIT(0), 0); + + +static const struct clk_hw *pll_periph_160M_hws[] = { + &pll_periph_160M_clk.hw, +}; + +static SUNXI_CCU_GATE_DATA(fanout_24M_clk, "fanout-24M", osc24M, + 0xf30, BIT(0), 0); +static SUNXI_CCU_GATE_DATA_WITH_PREDIV(fanout_12M_clk, "fanout-12M", osc24M, + 0xf30, BIT(1), 2, 0); +static SUNXI_CCU_GATE_HWS_WITH_PREDIV(fanout_16M_clk, "fanout-16M", pll_periph_160M_hws, + 0xf30, BIT(2), 10, 0); +static SUNXI_CCU_GATE_HWS_WITH_PREDIV(fanout_25M_clk, "fanout-25M", pll_periph_150M_hws, + 0xf30, BIT(3), 6, 0); + + +/* This clock has a second divider that is not modelled and forced to 0. */ +#define SUN8I_V853_FANOUT_27M_REG 0xf34 +static const struct clk_hw *fanout_27M_parents[] = { + &pll_video_1x_clk.hw, + &pll_csi_clk.hw, + &pll_periph_300M_clk.hw, +}; +static SUNXI_CCU_M_HW_WITH_MUX_GATE(fanout_27M_clk, "fanout-27M", + fanout_27M_parents, 0xf34, + 0, 5, /* M */ + 24, 2, /* mux */ + BIT(31), /* gate */ + 0); +static SUNXI_CCU_M_HWS_WITH_GATE(fanout_pclk_clk, "fanout-pclk", apb0_hws, 0xf38, + 0, 5, /* M */ + BIT(31), /* gate */ + 0); + +static const struct clk_parent_data fanout_parents[] = { + { .fw_name = "losc" }, + { .hw = &fanout_12M_clk.common.hw }, + { .hw = &fanout_16M_clk.common.hw }, + { .hw = &fanout_24M_clk.common.hw }, + { .hw = &fanout_25M_clk.common.hw }, + { .hw = &fanout_27M_clk.common.hw }, + { .hw = &fanout_pclk_clk.common.hw }, +}; + +static SUNXI_CCU_MUX_DATA_WITH_GATE(fanout0_clk, "fanout0", fanout_parents, 0xf3c, + 0, 3, /* mux */ + BIT(21), /* gate */ + 0); +static SUNXI_CCU_MUX_DATA_WITH_GATE(fanout1_clk, "fanout1", fanout_parents, 0xf3c, + 3, 3, /* mux */ + BIT(22), /* gate */ + 0); +static SUNXI_CCU_MUX_DATA_WITH_GATE(fanout2_clk, "fanout2", fanout_parents, 0xf3c, + 6, 3, /* mux */ + BIT(23), /* gate */ + 0); + + +static struct ccu_common *sun8i_v853_ccu_clks[] = { + &pll_cpu_clk.common, + &pll_ddr_clk.common, + &pll_periph_4x_clk.common, + &pll_periph_2x_clk.common, + &pll_periph_800M_clk.common, + &pll_periph_480M_clk.common, + &pll_video_4x_clk.common, + &pll_csi_4x_clk.common, + &pll_audio_div2_clk.common, + &pll_audio_div5_clk.common, + &pll_audio_4x_clk.common, + &pll_audio_1x_clk.common, + &pll_npu_4x_clk.common, + &cpu_clk.common, + &cpu_axi_clk.common, + &cpu_apb_clk.common, + &ahb_clk.common, + &apb0_clk.common, + &apb1_clk.common, + &de_clk.common, + &bus_de_clk.common, + &g2d_clk.common, + &bus_g2d_clk.common, + &ce_clk.common, + &bus_ce_clk.common, + &ve_clk.common, + &bus_ve_clk.common, + &npu_clk.common, + &bus_npu_clk.common, + &bus_dma_clk.common, + &bus_msgbox0_clk.common, + &bus_msgbox1_clk.common, + &bus_spinlock_clk.common, + &bus_hstimer_clk.common, + &avs_clk.common, + &bus_dbg_clk.common, + &bus_pwm_clk.common, + &bus_iommu_clk.common, + &dram_clk.common, + &mbus_dma_clk.common, + &mbus_ve_clk.common, + &mbus_ce_clk.common, + &mbus_csi_clk.common, + &mbus_isp_clk.common, + &mbus_g2d_clk.common, + &bus_dram_clk.common, + &mmc0_clk.common, + &mmc1_clk.common, + &mmc2_clk.common, + &bus_mmc0_clk.common, + &bus_mmc1_clk.common, + &bus_mmc2_clk.common, + &bus_uart0_clk.common, + &bus_uart1_clk.common, + &bus_uart2_clk.common, + &bus_uart3_clk.common, + &bus_i2c0_clk.common, + &bus_i2c1_clk.common, + &bus_i2c2_clk.common, + &bus_i2c3_clk.common, + &bus_i2c4_clk.common, + &spi0_clk.common, + &spi1_clk.common, + &spi2_clk.common, + &spi3_clk.common, + &bus_spi0_clk.common, + &bus_spi1_clk.common, + &bus_spi2_clk.common, + &bus_spi3_clk.common, + &spif_clk.common, + &bus_spif_clk.common, + &emac_25M_clk.common, + &bus_emac_clk.common, + &bus_gpadc_clk.common, + &bus_ths_clk.common, + &usb_ohci_clk.common, + &bus_ohci_clk.common, + &bus_ehci_clk.common, + &bus_otg_clk.common, + &i2s0_clk.common, + &i2s1_clk.common, + &bus_i2s0_clk.common, + &bus_i2s1_clk.common, + &dmic_clk.common, + &bus_dmic_clk.common, + &audio_codec_dac_clk.common, + &audio_codec_adc_clk.common, + &bus_audio_codec_clk.common, + &bus_dpss_top_clk.common, + &mipi_dsi_clk.common, + &bus_mipi_dsi_clk.common, + &tcon_lcd_clk.common, + &bus_tcon_lcd_clk.common, + &csi_top_clk.common, + &csi_mclk0_clk.common, + &csi_mclk1_clk.common, + &csi_mclk2_clk.common, + &bus_csi_clk.common, + &bus_wiegand_clk.common, + &riscv_clk.common, + &riscv_axi_clk.common, + &riscv_core_gate.common, + &riscv_cfg_gate.common, + &fanout_24M_clk.common, + &fanout_12M_clk.common, + &fanout_16M_clk.common, + &fanout_25M_clk.common, + &fanout_27M_clk.common, + &fanout_pclk_clk.common, + &fanout0_clk.common, + &fanout1_clk.common, + &fanout2_clk.common, +}; + +static struct clk_hw_onecell_data sun8i_v853_hw_clks = { + .num = CLK_NUMBER, + .hws = { + [CLK_OSC12M] = &osc12M_clk.hw, + [CLK_PLL_CPU] = &pll_cpu_clk.common.hw, + [CLK_PLL_DDR] = &pll_ddr_clk.common.hw, + [CLK_PLL_PERIPH_4X] = &pll_periph_4x_clk.common.hw, + [CLK_PLL_PERIPH_2X] = &pll_periph_2x_clk.common.hw, + [CLK_PLL_PERIPH_800M] = &pll_periph_800M_clk.common.hw, + [CLK_PLL_PERIPH_480M] = &pll_periph_480M_clk.common.hw, + [CLK_PLL_PERIPH_600M] = &pll_periph_600M_clk.hw, + [CLK_PLL_PERIPH_400M] = &pll_periph_400M_clk.hw, + [CLK_PLL_PERIPH_300M] = &pll_periph_300M_clk.hw, + [CLK_PLL_PERIPH_200M] = &pll_periph_200M_clk.hw, + [CLK_PLL_PERIPH_160M] = &pll_periph_160M_clk.hw, + [CLK_PLL_PERIPH_150M] = &pll_periph_150M_clk.hw, + [CLK_PLL_VIDEO_4X] = &pll_video_4x_clk.common.hw, + [CLK_PLL_VIDEO_2X] = &pll_video_2x_clk.hw, + [CLK_PLL_VIDEO_1X] = &pll_video_1x_clk.hw, + [CLK_PLL_CSI_4X] = &pll_csi_4x_clk.common.hw, + [CLK_PLL_AUDIO_DIV2] = &pll_audio_div2_clk.common.hw, + [CLK_PLL_AUDIO_DIV5] = &pll_audio_div5_clk.common.hw, + [CLK_PLL_AUDIO_4X] = &pll_audio_4x_clk.common.hw, + [CLK_PLL_AUDIO_1X] = &pll_audio_1x_clk.common.hw, + [CLK_PLL_NPU_4X] = &pll_npu_4x_clk.common.hw, + [CLK_CPU] = &cpu_clk.common.hw, + [CLK_CPU_AXI] = &cpu_axi_clk.common.hw, + [CLK_CPU_APB] = &cpu_apb_clk.common.hw, + [CLK_AHB] = &ahb_clk.common.hw, + [CLK_APB0] = &apb0_clk.common.hw, + [CLK_APB1] = &apb1_clk.common.hw, + [CLK_MBUS] = &mbus_clk.hw, + [CLK_DE] = &de_clk.common.hw, + [CLK_BUS_DE] = &bus_de_clk.common.hw, + [CLK_G2D] = &g2d_clk.common.hw, + [CLK_BUS_G2D] = &bus_g2d_clk.common.hw, + [CLK_CE] = &ce_clk.common.hw, + [CLK_BUS_CE] = &bus_ce_clk.common.hw, + [CLK_VE] = &ve_clk.common.hw, + [CLK_BUS_VE] = &bus_ve_clk.common.hw, + [CLK_NPU] = &npu_clk.common.hw, + [CLK_BUS_NPU] = &bus_npu_clk.common.hw, + [CLK_BUS_DMA] = &bus_dma_clk.common.hw, + [CLK_BUS_MSGBOX0] = &bus_msgbox0_clk.common.hw, + [CLK_BUS_MSGBOX1] = &bus_msgbox1_clk.common.hw, + [CLK_BUS_SPINLOCK] = &bus_spinlock_clk.common.hw, + [CLK_BUS_HSTIMER] = &bus_hstimer_clk.common.hw, + [CLK_AVS] = &avs_clk.common.hw, + [CLK_BUS_DBG] = &bus_dbg_clk.common.hw, + [CLK_BUS_PWM] = &bus_pwm_clk.common.hw, + [CLK_BUS_IOMMU] = &bus_iommu_clk.common.hw, + [CLK_DRAM] = &dram_clk.common.hw, + [CLK_MBUS_DMA] = &mbus_dma_clk.common.hw, + [CLK_MBUS_VE] = &mbus_ve_clk.common.hw, + [CLK_MBUS_CE] = &mbus_ce_clk.common.hw, + [CLK_MBUS_CSI] = &mbus_csi_clk.common.hw, + [CLK_MBUS_ISP] = &mbus_isp_clk.common.hw, + [CLK_MBUS_G2D] = &mbus_g2d_clk.common.hw, + [CLK_BUS_DRAM] = &bus_dram_clk.common.hw, + [CLK_MMC0] = &mmc0_clk.common.hw, + [CLK_MMC1] = &mmc1_clk.common.hw, + [CLK_MMC2] = &mmc2_clk.common.hw, + [CLK_BUS_MMC0] = &bus_mmc0_clk.common.hw, + [CLK_BUS_MMC1] = &bus_mmc1_clk.common.hw, + [CLK_BUS_MMC2] = &bus_mmc2_clk.common.hw, + [CLK_BUS_UART0] = &bus_uart0_clk.common.hw, + [CLK_BUS_UART1] = &bus_uart1_clk.common.hw, + [CLK_BUS_UART2] = &bus_uart2_clk.common.hw, + [CLK_BUS_UART3] = &bus_uart3_clk.common.hw, + [CLK_BUS_I2C0] = &bus_i2c0_clk.common.hw, + [CLK_BUS_I2C1] = &bus_i2c1_clk.common.hw, + [CLK_BUS_I2C2] = &bus_i2c2_clk.common.hw, + [CLK_BUS_I2C3] = &bus_i2c3_clk.common.hw, + [CLK_BUS_I2C4] = &bus_i2c4_clk.common.hw, + [CLK_SPI0] = &spi0_clk.common.hw, + [CLK_SPI1] = &spi1_clk.common.hw, + [CLK_SPI2] = &spi2_clk.common.hw, + [CLK_SPI3] = &spi3_clk.common.hw, + [CLK_BUS_SPI0] = &bus_spi0_clk.common.hw, + [CLK_BUS_SPI1] = &bus_spi1_clk.common.hw, + [CLK_BUS_SPI2] = &bus_spi2_clk.common.hw, + [CLK_BUS_SPI3] = &bus_spi3_clk.common.hw, + [CLK_SPIF] = &spif_clk.common.hw, + [CLK_BUS_SPIF] = &bus_spif_clk.common.hw, + [CLK_EMAC_25M] = &emac_25M_clk.common.hw, + [CLK_BUS_EMAC] = &bus_emac_clk.common.hw, + [CLK_BUS_GPADC] = &bus_gpadc_clk.common.hw, + [CLK_BUS_THS] = &bus_ths_clk.common.hw, + [CLK_I2S0] = &i2s0_clk.common.hw, + [CLK_I2S1] = &i2s1_clk.common.hw, + [CLK_BUS_I2S0] = &bus_i2s0_clk.common.hw, + [CLK_BUS_I2S1] = &bus_i2s1_clk.common.hw, + [CLK_DMIC] = &dmic_clk.common.hw, + [CLK_BUS_DMIC] = &bus_dmic_clk.common.hw, + [CLK_AUDIO_CODEC_DAC] = &audio_codec_dac_clk.common.hw, + [CLK_AUDIO_CODEC_ADC] = &audio_codec_adc_clk.common.hw, + [CLK_BUS_AUDIO_CODEC] = &bus_audio_codec_clk.common.hw, + [CLK_USB_OHCI] = &usb_ohci_clk.common.hw, + [CLK_BUS_OHCI] = &bus_ohci_clk.common.hw, + [CLK_BUS_EHCI] = &bus_ehci_clk.common.hw, + [CLK_BUS_OTG] = &bus_otg_clk.common.hw, + [CLK_BUS_DPSS_TOP] = &bus_dpss_top_clk.common.hw, + [CLK_MIPI_DSI] = &mipi_dsi_clk.common.hw, + [CLK_BUS_MIPI_DSI] = &bus_mipi_dsi_clk.common.hw, + [CLK_TCON_LCD] = &tcon_lcd_clk.common.hw, + [CLK_BUS_TCON_LCD] = &bus_tcon_lcd_clk.common.hw, + [CLK_CSI_TOP] = &csi_top_clk.common.hw, + [CLK_CSI_MCLK0] = &csi_mclk0_clk.common.hw, + [CLK_CSI_MCLK1] = &csi_mclk1_clk.common.hw, + [CLK_CSI_MCLK2] = &csi_mclk2_clk.common.hw, + [CLK_BUS_CSI] = &bus_csi_clk.common.hw, + [CLK_BUS_WIEGAND] = &bus_wiegand_clk.common.hw, + [CLK_RISCV] = &riscv_clk.common.hw, + [CLK_RISCV_AXI] = &riscv_axi_clk.common.hw, + [CLK_RISCV_CORE_GATE] = &riscv_core_gate.common.hw, + [CLK_RISCV_CFG_GATE] = &riscv_cfg_gate.common.hw, + [CLK_FANOUT_24M] = &fanout_24M_clk.common.hw, + [CLK_FANOUT_16M] = &fanout_16M_clk.common.hw, + [CLK_FANOUT_12M] = &fanout_12M_clk.common.hw, + [CLK_FANOUT_25M] = &fanout_25M_clk.common.hw, + [CLK_FANOUT_27M] = &fanout_27M_clk.common.hw, + [CLK_FANOUT_PCLK] = &fanout_pclk_clk.common.hw, + [CLK_FANOUT0] = &fanout0_clk.common.hw, + [CLK_FANOUT1] = &fanout1_clk.common.hw, + [CLK_FANOUT2] = &fanout2_clk.common.hw, + }, +}; + +static struct ccu_reset_map sun8i_v853_ccu_resets[] = { + [RST_MBUS] = { 0x540, BIT(30) }, + [RST_BUS_DE] = { 0x60c, BIT(16) }, + [RST_BUS_G2D] = { 0x63c, BIT(16) }, + [RST_BUS_CE] = { 0x68c, BIT(16) | BIT(17)}, + [RST_BUS_VE] = { 0x69c, BIT(16) }, + [RST_BUS_NPU] = { 0x6ec, BIT(16) }, + [RST_BUS_DMA] = { 0x70c, BIT(16) }, + [RST_BUS_MSGBOX0] = { 0x71c, BIT(16) }, + [RST_BUS_MSGBOX1] = { 0x71c, BIT(17) }, + [RST_BUS_SPINLOCK] = { 0x72c, BIT(16) }, + [RST_BUS_HSTIMER] = { 0x73c, BIT(16) }, + [RST_BUS_DBG] = { 0x78c, BIT(16) }, + [RST_BUS_PWM] = { 0x7ac, BIT(16) }, + [RST_BUS_DRAM] = { 0x80c, BIT(16) }, + [RST_BUS_MMC0] = { 0x84c, BIT(16) }, + [RST_BUS_MMC1] = { 0x84c, BIT(17) }, + [RST_BUS_MMC2] = { 0x84c, BIT(18) }, + [RST_BUS_UART0] = { 0x90c, BIT(16) }, + [RST_BUS_UART1] = { 0x90c, BIT(17) }, + [RST_BUS_UART2] = { 0x90c, BIT(18) }, + [RST_BUS_UART3] = { 0x90c, BIT(19) }, + [RST_BUS_I2C0] = { 0x91c, BIT(16) }, + [RST_BUS_I2C1] = { 0x91c, BIT(17) }, + [RST_BUS_I2C2] = { 0x91c, BIT(18) }, + [RST_BUS_I2C3] = { 0x91c, BIT(19) }, + [RST_BUS_I2C4] = { 0x91c, BIT(20) }, + [RST_BUS_SPI0] = { 0x96c, BIT(16) }, + [RST_BUS_SPI1] = { 0x96c, BIT(17) }, + [RST_BUS_SPI2] = { 0x96c, BIT(18) }, + [RST_BUS_SPI3] = { 0x96c, BIT(19) }, + [RST_BUS_SPIF] = { 0x96c, BIT(20) }, + [RST_BUS_EMAC] = { 0x97c, BIT(16) }, + [RST_BUS_GPADC] = { 0x9ec, BIT(16) }, + [RST_BUS_THS] = { 0x9fc, BIT(16) }, + [RST_BUS_I2S0] = { 0xa20, BIT(16) }, + [RST_BUS_I2S1] = { 0xa20, BIT(17) }, + [RST_BUS_DMIC] = { 0xa4c, BIT(16) }, + [RST_BUS_AUDIO_CODEC] = { 0xa5c, BIT(16) }, + [RST_USB_PHY] = { 0xa70, BIT(30) }, + [RST_BUS_OHCI] = { 0xa8c, BIT(16) }, + [RST_BUS_EHCI] = { 0xa8c, BIT(20) }, + [RST_BUS_OTG] = { 0xa8c, BIT(24) }, + [RST_BUS_DPSS_TOP] = { 0xabc, BIT(16) }, + [RST_BUS_MIPI_DSI] = { 0xb4c, BIT(16) }, + [RST_BUS_TCON_LCD] = { 0xb7c, BIT(16) }, + [RST_BUS_CSI] = { 0xc2c, BIT(16) }, + [RST_BUS_WIEGAND] = { 0xc7c, BIT(16) }, + [RST_RISCV_SYS_APB] = { 0xd04, BIT(2), CCU_FEATURE_KEY_FIELD }, + [RST_RISCV_SOFT] = { 0xd04, BIT(1), CCU_FEATURE_KEY_FIELD }, + [RST_RISCV_CFG] = { 0xd0c, BIT(16) } +}; + +static const struct sunxi_ccu_desc sun8i_v853_ccu_desc = { + .ccu_clks = sun8i_v853_ccu_clks, + .num_ccu_clks = ARRAY_SIZE(sun8i_v853_ccu_clks), + + .hw_clks = &sun8i_v853_hw_clks, + + .resets = sun8i_v853_ccu_resets, + .num_resets = ARRAY_SIZE(sun8i_v853_ccu_resets), +}; + +static const u32 pll_regs[] = { + SUN8I_V853_PLL_CPU_REG, + SUN8I_V853_PLL_DDR_REG, + SUN8I_V853_PLL_PERIPH_REG, + SUN8I_V853_PLL_VIDEO_REG, + SUN8I_V853_PLL_CSI_REG, + SUN8I_V853_PLL_AUDIO_REG, + SUN8I_V853_PLL_NPU_REG, +}; + +static int sun8i_v853_ccu_probe(struct platform_device *pdev) +{ + void __iomem *reg; + u32 val; + int i, ret; + + reg = devm_platform_ioremap_resource(pdev, 0); + if (IS_ERR(reg)) + return PTR_ERR(reg); + + /* Enable the enable, LDO, and lock bits on all PLLs. */ + for (i = 0; i < ARRAY_SIZE(pll_regs); i++) { + val = readl(reg + pll_regs[i]); + val |= BIT(31) | BIT(30) | BIT(29); + writel(val, reg + pll_regs[i]); + } + + /* Force PLL_CPU factor M to 0. */ + val = readl(reg + SUN8I_V853_PLL_CPU_REG); + val &= ~GENMASK(1, 0); + writel(val, reg + SUN8I_V853_PLL_CPU_REG); + + /* + * Force OHCI 12M clock source to 00 (12MHz divided from 48MHz) + * + * This clock mux is still mysterious, and the code just enforces + * it to have a valid clock parent. + */ + val = readl(reg + SUN8I_V853_USB_CLK_REG); + val &= ~GENMASK(25, 24); + writel(val, reg + SUN8I_V853_USB_CLK_REG); + + /* Force fanout-27M factor N to 0. */ + val = readl(reg + SUN8I_V853_FANOUT_27M_REG); + val &= ~GENMASK(9, 8); + writel(val, reg + SUN8I_V853_FANOUT_27M_REG); + + ret = devm_sunxi_ccu_probe(&pdev->dev, reg, &sun8i_v853_ccu_desc); + if (ret) + return ret; + + return 0; +} + +static const struct of_device_id sun8i_v853_ccu_ids[] = { + { .compatible = "allwinner,sun8i-v853-ccu" }, + { } +}; + +static struct platform_driver sun8i_v853_ccu_driver = { + .probe = sun8i_v853_ccu_probe, + .driver = { + .name = "sun8i-v853-ccu", + .suppress_bind_attrs = true, + .of_match_table = sun8i_v853_ccu_ids, + }, +}; +module_platform_driver(sun8i_v853_ccu_driver); + +MODULE_IMPORT_NS("SUNXI_CCU"); +MODULE_DESCRIPTION("Support for the Allwinner V853 CCU"); +MODULE_LICENSE("GPL"); diff --git a/drivers/clk/sunxi-ng/ccu-sun8i-v853.h b/drivers/clk/sunxi-ng/ccu-sun8i-v853.h new file mode 100644 index 000000000000..f1b2a4d0bcd3 --- /dev/null +++ b/drivers/clk/sunxi-ng/ccu-sun8i-v853.h @@ -0,0 +1,14 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Copyright (C) 2024 Andras Szemzo + */ + +#ifndef _CCU_SUN8I_V853_H_ +#define _CCU_SUN8I_V853_H_ + +#include +#include + +#define CLK_NUMBER (CLK_FANOUT2 + 1) + +#endif From patchwork Wed Feb 5 12:52:20 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andras Szemzo X-Patchwork-Id: 13961001 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 62E97C02192 for ; Wed, 5 Feb 2025 13:04:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=aZ+VTE5k0sR1ZK3QqyyvU9VyA3FsM9Zod0FdH9bBQvk=; b=mUUUzpLbIX+Z40YByxlNUAargn hcQ//DmlzdBSGs9eph708+Ss0r4YOKzRRAgJM+HNlStslIExM03GQOQQV8HSWy+L1viQxSNeU7UGM vqqb1E4hxZFPHTYa7YlsMbzB+GUANwmZfqefVu97aRAzVypQ4+5vox+V4YA00Q8PwSmadnRcPriZo ekQjLpfKdfFw/WiQsiJ7Gg4byyZkaKfjI12r/2bvRPtSQ6is8EPCOfCpSF9paK8VA5VSxv+wEL7Wb S5rb+587L6+GFXvtjIyu2UmFV3QCjkQp9YoGTSGPBHmXL7pEgjL9meFg9Hg0l28ww46cdn59Y9vX7 3rvojNkg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tff4H-00000003KZS-3H9u; Wed, 05 Feb 2025 13:03:49 +0000 Received: from mail-ed1-x52f.google.com ([2a00:1450:4864:20::52f]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tfetT-00000003Hra-0TZj; Wed, 05 Feb 2025 12:52:40 +0000 Received: by mail-ed1-x52f.google.com with SMTP id 4fb4d7f45d1cf-5dca451f922so6549157a12.2; Wed, 05 Feb 2025 04:52:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1738759957; x=1739364757; darn=lists.infradead.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=aZ+VTE5k0sR1ZK3QqyyvU9VyA3FsM9Zod0FdH9bBQvk=; b=lbq0lONY9GXjY/wDTRqQtsBZk1SvM7aEsv71rhlcVTSFlwPRAC86QkstNnDyx/b4iv QKUTzaUwZeMyzqhWbcpz44XsW52lq88grMPMDKUwOymA4817TvJkbCpCkEuxnLro3N5w iBRMTsyUyDCsnrJj4ZvYZ1UpMkTcP+X8RhTfyyQ61oQs4OTjmlUgz4XcWABqFyT4IULf Joh3/N2VxxjiyEGqipBRUCIP8zUKj/NvXBBWcj1JE0drqcNwNAkF77/CAdDWzsNBGQ/n 9LOWjW1s76u/1zkcEQg7CgjwFj3vfPqoCyNibpN9Lq2xqlbXP2dIQ74Z8lIlcOHcda/i 7Bqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738759957; x=1739364757; 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=aZ+VTE5k0sR1ZK3QqyyvU9VyA3FsM9Zod0FdH9bBQvk=; b=cHlsi4vXGogqYNguRdqQjBo3cEQZ5IUEQX4ILJ/+mgZro1mqTxTo40t5sjP/UEXrmx V/PHSWJoeERWTZc4KOLcvprz7Sh4idOOQnVTKq4XrZ67Vgv8BlDZ7EIQvYBnASn3Z90O 2s3yGeD6/1ioOKwxdJVTU8+rJxQE3fSnzgW/YmA3tDRG5CbaDSDKHZUsFGQngHJS5HOA KKr8U8saYH0LaeAlm7dJnIiq8wLiEmTwMdhvea+dxh/oYCa6Y1RumqfAxWmCUe/bqUoL TCxENjEizzqrv2wGSkpMHbMoqze949H/YN5LDeIehQzRebnugGjBrlMF+o3bjqH+n7ws kvCg== X-Forwarded-Encrypted: i=1; AJvYcCURLxbJ1STNeKvmNEFnnR7vWCeP1qMHGFNfm8alEP5cuuKvnFr5z/BIUWVfRjt0jV9Qn9pLRGkMhD+Im+//6YJZ@lists.infradead.org, AJvYcCXHKTidACbe45kZOCilguLRV3YPHgXFgMg7q8XyB/rVNldN1kHE0EOUA6pW5jUqQDoBWqTyr3S2ur4BP24=@lists.infradead.org, AJvYcCXNpz2ciXerS+nGJZdltmGD3oeJFfpL4oThnbyAgeqxnQNJL2YM28U5OxMzBR0RL/4Qxmm46LVEmRVB@lists.infradead.org X-Gm-Message-State: AOJu0YwTAhb670YgaxKQfHTJP/pJR1JH2GsFY5euuX5oERamT5rs4/ht VT/d9uaZBfKomt4t7Qu6iwniTjjsflFRA2HT/W6Pf8mXBT+3g2bT X-Gm-Gg: ASbGncvAVI/z0hxUI2Q5goKKfcxZeOBTerglMpHNvZw7XqICGK37VLy4nReGPmNdwCT 3Y6ZhquY4o8c1UsYRsJjawljW+RYhz4f/zz6THERlVsmtq0lW7q/PzNnys4O5MwaSJp6aSh0pbw tPTWbnz0VmNkDqQz+B5dBtgUxmDv1Pozx2Giw5fGUAMynr6PQyI36ajZ3u8uccGYfwVlGJg6Ao5 +bPzbbFgy+jNfsps80qpNgTHTHciwrvLRV2/CrGxwUelzWQb5H5uBUjNyE0pzCSK/YZnme5qTos AT+WqSrUiOvLEwvwkGfiK8n0coII/reXKnzCUcO5DXFnCQ== X-Google-Smtp-Source: AGHT+IGRhSv9Imhm+auTjNV2o2DuhUhkhyLQG8J8I3Ur0Zu+jneuDXHk2hYm/9qI5G8NhBI2TZOWSA== X-Received: by 2002:a05:6402:278e:b0:5dc:c869:da4f with SMTP id 4fb4d7f45d1cf-5dcdb7645cfmr2783894a12.24.1738759957120; Wed, 05 Feb 2025 04:52:37 -0800 (PST) Received: from localhost.localdomain (185.174.17.62.zt.hu. [185.174.17.62]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5dc724055e5sm11559997a12.45.2025.02.05.04.52.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Feb 2025 04:52:36 -0800 (PST) From: Andras Szemzo To: Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Linus Walleij , Philipp Zabel , Maxime Ripard Cc: Vinod Koul , Kishon Vijay Abraham I , Ulf Hansson , Paul Walmsley , Palmer Dabbelt , Albert Ou , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Florian Fainelli , linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, linux-gpio@vger.kernel.org, linux-pm@vger.kernel.org, linux-riscv@lists.infradead.org Subject: [PATCH v2 05/10] dt-bindings: power: add V853 ppu bindings Date: Wed, 5 Feb 2025 13:52:20 +0100 Message-Id: <20250205125225.1152849-6-szemzo.andras@gmail.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250205125225.1152849-1-szemzo.andras@gmail.com> References: <20250205125225.1152849-1-szemzo.andras@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250205_045239_150738_B9620F4A X-CRM114-Status: GOOD ( 12.99 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Document V853 PPU compatible. Signed-off-by: Andras Szemzo --- .../bindings/power/allwinner,sun20i-d1-ppu.yaml | 1 + include/dt-bindings/power/allwinner,sun8i-v853-ppu.h | 10 ++++++++++ 2 files changed, 11 insertions(+) create mode 100644 include/dt-bindings/power/allwinner,sun8i-v853-ppu.h diff --git a/Documentation/devicetree/bindings/power/allwinner,sun20i-d1-ppu.yaml b/Documentation/devicetree/bindings/power/allwinner,sun20i-d1-ppu.yaml index 46e2647a5d72..f578be6a3bc8 100644 --- a/Documentation/devicetree/bindings/power/allwinner,sun20i-d1-ppu.yaml +++ b/Documentation/devicetree/bindings/power/allwinner,sun20i-d1-ppu.yaml @@ -17,6 +17,7 @@ properties: compatible: enum: - allwinner,sun20i-d1-ppu + - allwinner,sun8i-v853-ppu reg: maxItems: 1 diff --git a/include/dt-bindings/power/allwinner,sun8i-v853-ppu.h b/include/dt-bindings/power/allwinner,sun8i-v853-ppu.h new file mode 100644 index 000000000000..b1c18a490613 --- /dev/null +++ b/include/dt-bindings/power/allwinner,sun8i-v853-ppu.h @@ -0,0 +1,10 @@ +/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */ + +#ifndef _DT_BINDINGS_POWER_SUN8I_V853_PPU_H_ +#define _DT_BINDINGS_POWER_SUN8I_V853_PPU_H_ + +#define PD_RISCV 0 +#define PD_NPU 1 +#define PD_VE 2 + +#endif From patchwork Wed Feb 5 12:52:21 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andras Szemzo X-Patchwork-Id: 13961143 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 283EEC02192 for ; Wed, 5 Feb 2025 14:16:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ZEOAzVx6WPB9stA5mr4n7x/fL+LclH0gvOV71KsByXY=; b=2CgPf/m7tLzUyJbXA66BcOrK+E X/nINwis6wIw8dpS6Hp5fqsJJHOMBxDuxJJc2ZzLFzx5zSV+Clx2KBv+M0qKC+McgzxLdC7kQIMmf A+Mio2pai6IdpSleX1dmCmQ3LwpMD+N+hleRyAHPNVxfS5YewrOR6e+232SoN27y0AiX3/eAwLK4M 7OZMV8eQclSMZb8IC7X2ah1/pxQbpt+v1FhhtOj5M6L8Jxg1N/KozDgqqQ2WV4VdyKMxmfidu0orE JSa1WLy4Bu3STUtjLgOnWHAGxI7qVQwuQER+Iw3Ic3CB05RntaXTIDHjI4idAtP1zj65TQ+fJK9wK szRq1FpA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tfgCH-00000003VZW-2X41; Wed, 05 Feb 2025 14:16:09 +0000 Received: from mail-ej1-x634.google.com ([2a00:1450:4864:20::634]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tfetU-00000003HsB-1KOR; Wed, 05 Feb 2025 12:52:41 +0000 Received: by mail-ej1-x634.google.com with SMTP id a640c23a62f3a-aaf900cc7fbso1383304966b.3; Wed, 05 Feb 2025 04:52:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1738759959; x=1739364759; darn=lists.infradead.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=ZEOAzVx6WPB9stA5mr4n7x/fL+LclH0gvOV71KsByXY=; b=Rx0oBpT+u0IEmjz3GNnYxkuk+3QIeSwVU7JC8BmUxMFF8kyD10GPrvg/dwCW7fkxuz +zjlrM3AcwmOVPRPA2UaUQudGVNJis7x/mjOAF+1N/vJ5kOd6LVOZh/Sadt10Em8hraq JgpADOzT12oMDMXdHVvTewSoFAIOkj2RRMM43f6rjjyCarI0/UqELw/mh4NYJQGlwWTX cP9sIJEOZAib0Q7KZrOPB+loCdj48DDx+Uwt/JkQFWHdq44J8nRXJQoCoLFTYqzhEVlt 0O1geMQWinbtOUvfHk3eIjqi1oTikbyuFsP77ETI6P4kC2TybwLkzy9l2hyPxyLAlsBV WdVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738759959; x=1739364759; 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=ZEOAzVx6WPB9stA5mr4n7x/fL+LclH0gvOV71KsByXY=; b=IikbQPnpD8Y7NOoQJdC+YbZbgydH7VFAYwW4uHvaMfaMykEDq4NQ+jJlb07wEmU+Mq JxZkvVh0QhPNT67rQj+KQceFNUf8xv8pKCMxZW/967dmcWu/X7D/Hi/39EUo0XnvRH0c pAm6XrSf1/PCRdbocIYsqAd5+knwSz3Eey9pB1SnbECw7lvhXG0ypA4G1Lj4v2xZWF+m AUffl1vM9LaMNXt5QJSH5CjM02mEgKRLh1kexJq8oN4jpqUzjwfAKUs4OqQaus6GmNLp 5zYQO8zfUqiktGkOAP/6qhHMt/uykv3bcZPvLRuF/3T/YOWBTcfRzU5e3vhFTz6r20hw 96mw== X-Forwarded-Encrypted: i=1; AJvYcCVRZsjQoV0A1y7iiIunezkWrlgWM5BaJp+bgsM8MfKXiohj+/2JBysnDZWM4o8ih+kKmo+ustUEPmooci2BCbBh@lists.infradead.org, AJvYcCWJUHRuftwbYnpSNyem0uz+GVCIcSbLHn1GeR1WyWxew+7ni00WPchfkaO/eaxVJefy4Qv++4DyqBM83no=@lists.infradead.org, AJvYcCXEVJ5xkZE6HdKOTQ1Q95Ar8T2RZoMZqpmsSSV1fLEMFHifANbJNW3DjkkTJiHYDnGngdno2FuQknh5@lists.infradead.org X-Gm-Message-State: AOJu0Yzy5MFb4PxuWHdRQXvswcac3pa7YDfZG9efGul6cm4IMMtUvH9W iLiASDLmV9Dk/IpIEUp2ToGuBjFjYE+HYN/61Aty1k0Ut37TAWDc X-Gm-Gg: ASbGncs7pSwUkbgtmKY7DAb2KaTvrRcECHVImSz8ouwhWRQOiqPNgIPtf6IZDFOFxjZ 5FCy9NMPtiBW8hwmG/8Kc8Ta/PmKnWQrDjPPw4tVX0UOkefrgv5DTWgSnriYYiOafJxcFJnNWLg peuYO/HtD+aip3gOYAjte20oB53f7z+RDofxIARVnsAGO4WdaL5nkDxNRbA72ahd2MEbczGayDE rwYphWPg39uNOS3r3KCgfAa+D1Oa2VcVVBII0M0vrKdYF5BTqYQ0pqqWN5sTPWwLfmDXOeFW5Js LPcZA+MS+3/VFzxeuXFsVmpTW9pQ6KOab5wyYc0eHa35sA== X-Google-Smtp-Source: AGHT+IGXrMqsMiP0zkOFbpXcUy0rvilFMJQHNVAo7U33xcsXTT7GzHgk1vRH+nlowH9w2lytesYKDg== X-Received: by 2002:a17:907:3fa1:b0:aaf:86a2:651f with SMTP id a640c23a62f3a-ab75e2fc295mr281783466b.38.1738759958692; Wed, 05 Feb 2025 04:52:38 -0800 (PST) Received: from localhost.localdomain (185.174.17.62.zt.hu. [185.174.17.62]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5dc724055e5sm11559997a12.45.2025.02.05.04.52.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Feb 2025 04:52:38 -0800 (PST) From: Andras Szemzo To: Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Linus Walleij , Philipp Zabel , Maxime Ripard Cc: Vinod Koul , Kishon Vijay Abraham I , Ulf Hansson , Paul Walmsley , Palmer Dabbelt , Albert Ou , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Florian Fainelli , linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, linux-gpio@vger.kernel.org, linux-pm@vger.kernel.org, linux-riscv@lists.infradead.org Subject: [PATCH v2 06/10] pmdomain: sunxi: add V853 ppu support Date: Wed, 5 Feb 2025 13:52:21 +0100 Message-Id: <20250205125225.1152849-7-szemzo.andras@gmail.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250205125225.1152849-1-szemzo.andras@gmail.com> References: <20250205125225.1152849-1-szemzo.andras@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250205_045240_369475_543648AF X-CRM114-Status: GOOD ( 11.08 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org V853 has a similar ppu like Allwinner D1, add compatible and the available pd names. Signed-off-by: Andras Szemzo --- drivers/pmdomain/sunxi/sun20i-ppu.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/pmdomain/sunxi/sun20i-ppu.c b/drivers/pmdomain/sunxi/sun20i-ppu.c index 8700f9dd5f75..9f002748d224 100644 --- a/drivers/pmdomain/sunxi/sun20i-ppu.c +++ b/drivers/pmdomain/sunxi/sun20i-ppu.c @@ -182,11 +182,26 @@ static const struct sun20i_ppu_desc sun20i_d1_ppu_desc = { .num_domains = ARRAY_SIZE(sun20i_d1_ppu_pd_names), }; +static const char *const sun8i_v853_ppu_pd_names[] = { + "RISCV", + "NPU", + "VE", +}; + +static const struct sun20i_ppu_desc sun8i_v853_ppu_desc = { + .names = sun8i_v853_ppu_pd_names, + .num_domains = ARRAY_SIZE(sun8i_v853_ppu_pd_names), +}; + static const struct of_device_id sun20i_ppu_of_match[] = { { .compatible = "allwinner,sun20i-d1-ppu", .data = &sun20i_d1_ppu_desc, }, + { + .compatible = "allwinner,sun8i-v853-ppu", + .data = &sun8i_v853_ppu_desc, + }, { } }; MODULE_DEVICE_TABLE(of, sun20i_ppu_of_match); From patchwork Wed Feb 5 12:52:22 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andras Szemzo X-Patchwork-Id: 13961008 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8A1A6C02192 for ; Wed, 5 Feb 2025 13:06:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=fnyUK6beMeleaf/vnmqhL9TlcUqLD4J+xrVEoCblRp0=; b=081xhsEokf/pcGFX/JVgGzgzXM LjBhHrlsdb60lNR5MCGgo5RVoDLuENBmOvp/k1LiQJV8pNMaNEgp/H3dgsFVy1nT9frK3zkzCMKHd e6BzDSK3F+KNlrhR6oSJo062uslg67oJNiF8iHRm4T7rl0kEVvYqUsUD0eQj6ObtgmB3GHXG4tYW7 nPIomzRnfvBDWGyApqTYMqNeo/79f8AzaCz3xPv8+CswgtaePnTrShHy8ZHbm29dMDGnh+TZhTLlD tvkdy2/J15L334DGgvSsWQ6HBgWUcYLw630PLhLqiATsy7VkpRV0C6TJlTzd1cMiqdZ+gBBibf4Af jXXClX1w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tff75-00000003Kzk-3M9Z; Wed, 05 Feb 2025 13:06:43 +0000 Received: from mail-ed1-x531.google.com ([2a00:1450:4864:20::531]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tfetW-00000003Hst-183O; Wed, 05 Feb 2025 12:52:43 +0000 Received: by mail-ed1-x531.google.com with SMTP id 4fb4d7f45d1cf-5dce1d61b44so630121a12.2; Wed, 05 Feb 2025 04:52:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1738759960; x=1739364760; darn=lists.infradead.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=fnyUK6beMeleaf/vnmqhL9TlcUqLD4J+xrVEoCblRp0=; b=WC3x9wW5238wZABIHIXrXhsgb+wpDFZPqGuaKo6JC3EqtlPGfCQyyD33RD6Pqg0TgO ByHD3SL290/tmMimXyAzCq6cD1RPQzTX4C14eqKtgMRGbkEFp3xYvK0LC6uD0JlSNpox jyMyfzl+9sbkbR7uIFbYnAeX5EiB1XJJHktNDx5K2/TiWXJeBM1uBoXaeRivxcp/J+E5 nfHtkI+E7oXQf0RON/QCb4OzV4SO59vzK1ptHawGf/FOihQYVU2h86cThYC26d154LnX RABIVRzgDlZPxkNlGxL/8bpVs9fLslOovXzQb12qv03LVB55WoyWmCbFjfM/7Co1UbYR Q/8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738759960; x=1739364760; 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=fnyUK6beMeleaf/vnmqhL9TlcUqLD4J+xrVEoCblRp0=; b=Vwrx41fj1uE3UYpXivjHndEo1+knuvxXTbcbnKUeMljWHu9gC2PxfzyFPAy2xR0jPN L2MLcIX4nyXLMxQfKZiMPfsWC/HU446ujZ4DvdD0CHQgG2MDvxYDrwPO1ADxYHZ3MJaN vWx5TXBEne6kUzTKtEHvDwswk7y4WsVifDoN3jI80loYjB4Wgj0JeManikChd/XA3wWV f16P+zRIT+b9Qsh1x/kx8BeKyO0CAiWB4CDqM1EvKM4UKAoEddXm8hGkfy85B5C9WX8m rUqCEaTBZpCd46Fqjcr1tamQ16NEWaKeOpTNVYy7WkPGUWNDJImyEkcwY3FhIfU/LX4k /HNA== X-Forwarded-Encrypted: i=1; AJvYcCWtvBzMSc4dC6uWhRihDugwTFkgU5xgoA2FVG13fbMZ27PPjvd/srGtKYhWtWFatOlykPOp1PMI9A9g@lists.infradead.org, AJvYcCX3I4IJPgNIb2ZlmXruVaCmAD9H5XhMEk0L4iJT1qtLTNGPcrzdH2kIufooZ6GJCzMqJpJIpp/KVKnh/MknL0R0@lists.infradead.org, AJvYcCXcWLSubHcnivpHGA4OIOcjm+Rx+tA6SRihuX8Jd47I7DkcUeIgqyuWxjwBXkdrIvTTpRsCdo+tk94DExI=@lists.infradead.org X-Gm-Message-State: AOJu0Yz0vQVRi6zUqP+BhhuxfOncgh4A9U2SkMoqOBJ8iqjfWmHJ7Ed5 /uqu/iGoNsF6e7DzI/yakBguCup7iiAjRZnyP2QZCCQwbT+xsy6e X-Gm-Gg: ASbGncsFwsaERB1EgF2MtOCKGp2YN2/aOZe1Lf2h5WfDm1hO3dF1E+OmJtCDsvWJsgY MAg2SS2Xcaej/27URgVPeLIRuIL1jEyLXSDkc1cqTNe3JBD+XDQeggPMZ8ogIyDKr/nWyIsezNC pqGZdQbVXsVPXFyKlgbzFtGxfR2+z75wmrNcdXaTd2dnnjvb1bmVOZqwNHSAeDpz51N2if8JIgu M8+C5lka1oE4MuHYYEmzwNWl6qZjGTG3Rf5DFHVwxQD+Itak0DElg1X930vpA2fXUqhYuBP1aC3 s/jl17aennxXa8FXiWe9Gv/NkT4/ugyJKoFfgpj4WzNVOw== X-Google-Smtp-Source: AGHT+IE0wywWb/Z15BOQfyDS/LKQnpnhSIPGUcQiGwnAhhs+76luZoRksyVgrmGjUEmSc4D72uhXsQ== X-Received: by 2002:a05:6402:388c:b0:5d9:8877:895a with SMTP id 4fb4d7f45d1cf-5dcdb732cd0mr3410442a12.17.1738759960294; Wed, 05 Feb 2025 04:52:40 -0800 (PST) Received: from localhost.localdomain (185.174.17.62.zt.hu. [185.174.17.62]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5dc724055e5sm11559997a12.45.2025.02.05.04.52.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Feb 2025 04:52:39 -0800 (PST) From: Andras Szemzo To: Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Linus Walleij , Philipp Zabel , Maxime Ripard Cc: Vinod Koul , Kishon Vijay Abraham I , Ulf Hansson , Paul Walmsley , Palmer Dabbelt , Albert Ou , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Florian Fainelli , linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, linux-gpio@vger.kernel.org, linux-pm@vger.kernel.org, linux-riscv@lists.infradead.org Subject: [PATCH v2 07/10] dt-bindings: phy: allwinner: add v853 usb phy Date: Wed, 5 Feb 2025 13:52:22 +0100 Message-Id: <20250205125225.1152849-8-szemzo.andras@gmail.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250205125225.1152849-1-szemzo.andras@gmail.com> References: <20250205125225.1152849-1-szemzo.andras@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250205_045242_307012_BF4FDA51 X-CRM114-Status: UNSURE ( 9.48 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Document Allwinner v853 USB phy. Signed-off-by: Andras Szemzo --- .../devicetree/bindings/phy/allwinner,sun50i-a64-usb-phy.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/phy/allwinner,sun50i-a64-usb-phy.yaml b/Documentation/devicetree/bindings/phy/allwinner,sun50i-a64-usb-phy.yaml index 21209126ed00..815742c4f5fb 100644 --- a/Documentation/devicetree/bindings/phy/allwinner,sun50i-a64-usb-phy.yaml +++ b/Documentation/devicetree/bindings/phy/allwinner,sun50i-a64-usb-phy.yaml @@ -19,9 +19,11 @@ properties: - enum: - allwinner,sun20i-d1-usb-phy - allwinner,sun50i-a64-usb-phy + - allwinner,sun8i-v853-usb-phy - items: - const: allwinner,sun50i-a100-usb-phy - const: allwinner,sun20i-d1-usb-phy + - const: allwinner,sun8i-v853-usb-phy reg: items: From patchwork Wed Feb 5 12:52:23 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andras Szemzo X-Patchwork-Id: 13961009 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 06890C02192 for ; Wed, 5 Feb 2025 13:08:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=QrjpVKFbSRrE6vHiGeiawaeS65c9c+jYODEjMxySj+o=; b=J6QGdDbWXAa8KP1XbmU8Kfje6N xi0j4hqz9pIUkrTHG0PLJe3Rw1bmSsFUpj4les46ibIIADieRJVVWi46L5U2Wu7qt4gSurf6BSYQJ mpkakCeCnbZ30oI2aY9D08fTqdtkhXJ/nw1xA9EORoji4bQUbnUGhazFGtsRdaaHLEifk9D2asDnG ISfUn0NzFdE6PPcC4iMcupK8Xq1VcDnNjlr2fKWBMg9td9olyG477i9wLEv9ycoGe0/YYU9ZGrEvv tQ6tDhXxti9uVkRde0J9k5XzJjb6MFuKKhWYVVZH8hCa1eGqh3M034Lo4UFTuQrRM8LVibDwq9dWT 6+glqHzg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tff8R-00000003LHc-1h9r; Wed, 05 Feb 2025 13:08:07 +0000 Received: from mail-ed1-x534.google.com ([2a00:1450:4864:20::534]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tfetY-00000003HuN-1GTh; Wed, 05 Feb 2025 12:52:45 +0000 Received: by mail-ed1-x534.google.com with SMTP id 4fb4d7f45d1cf-5dca451f922so6549327a12.2; Wed, 05 Feb 2025 04:52:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1738759963; x=1739364763; darn=lists.infradead.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=QrjpVKFbSRrE6vHiGeiawaeS65c9c+jYODEjMxySj+o=; b=inXdcmlsJfht5e7RNgWiN4uXAiV+U2ZUp6L/iUK0bTd5yxK+9i9q0aA16C5PbS3wzg WAtItpPvClN+57hobVi055JtTqzZpDPKCNJ1VYLDcR0S6140LuCHZhZHz3Zz0KMcr4Iz 6ALhnZSP6PFv4fAeULJ9OBftUaSt6ELLYGL+Yv9LDx0pdFDSRYs+p2/Sgl1ONXCVLjFX TIVGR9t7/XDO9F2Jp/6BWZzHzwTQWEcNz9vwBupC5ioBCuD6eC+S9+VkjkIBUBshq/K7 R+sb8Awi/piEagqNRhuS8oUVazYD822+LoEPZs4+y34ANqQ/WL0W0Ps2571xfDnq6MHI 26Gg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738759963; x=1739364763; 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=QrjpVKFbSRrE6vHiGeiawaeS65c9c+jYODEjMxySj+o=; b=rvL2janWS+y1mXKFUgxzJqUHpqgr7viuFVMUxmy0ijEK6z/1alCTnHKLaQGCv7UfeQ Li3FDTzMd+zTRziOspro9BRusvUWF5Bpst9spRGW1Lhl7HDB7uwE761RdekzPMnhnr9L y8omRTPERfz7/DDef8A/Q5qw+QA9kpoON+PF1Lg4MfBviObk8n0ToqYK3raNGrsn2QIT hHALuxIgMGEW+xFf+IUBhK5E5wh28Kn39xTufgllcOkfPsOIq2W0a64PsosPHXETkD3r myYTq0yczF5WQysxjDy37pILYdEWORP0RMdYI29kG0Deqq6YWFWLcAl/gy1CCkpDmM0W b0qA== X-Forwarded-Encrypted: i=1; AJvYcCV5rmnwbRTjiiUU8V9wUXcoWdpSTxWE02UDyPFPCv1T44S+q0S+RE8/Y9bfM/BK8xseeSHI0Grj3JEqEdw=@lists.infradead.org, AJvYcCX89aTIqvoIe6Uhcx4vdHjoggNf385c3sDi98JWLIcAdgj4dikKG0d3AqGSzoSd74TQMtxzwo4wZN9K@lists.infradead.org, AJvYcCXzJh52x6oA2BRHjUxZDOuaeba+fzj2S1tzp9Ug3zBZCnNhgM1NA3+fSjEBSqi5wVAx4P71LTvBDfA1mAHiGpv6@lists.infradead.org X-Gm-Message-State: AOJu0YzsBUjIFmIw0E5WLGFG6lAABOBIR97s5ZcXxjLGjmcu8IPzub/a U80ZUeynUUFtnC/n2jGOol3PWfw0yFUBeawjXc9DfGIU25SjuP9E X-Gm-Gg: ASbGncsjSHni2vxmK+El57xnniBpe4bqAdBVCJq/VjHv6wPa9B9s9pTgxDA/3uFnG8O KkJM7PfX/dOvSY34juz3eCfz5QPqDev74WDEvexf+Rexi9nhgw14pbA4wV5xA1fLBxzewn+bkkm tdI4/dcqTTEqEbNI03j4IIHELpHOdlNmd5bAs4bmz36ttJ6n/ab3T50LBtEv3dIe/kNeueZEVcL Oi3KVta38h6goc0KS5qdBa1peGuEoYVi2b1Hw39R1Db/z58JedSPYieW2gybrLJfKKRCWxTIFLQ PcmXYJ4QK8CXm+incRgPgwDU0RraabqMd1sKfHd4FbDXcg== X-Google-Smtp-Source: AGHT+IF6zoFHYoDLjXMYqUkNt9+F9g1qPDmsrM4f/DRoKSMpr0i16Ws07ZzIUfLBaqBzFn0iR+ySiQ== X-Received: by 2002:a05:6402:5d5:b0:5dc:7464:2228 with SMTP id 4fb4d7f45d1cf-5dcdb6fff0bmr2892117a12.2.1738759962631; Wed, 05 Feb 2025 04:52:42 -0800 (PST) Received: from localhost.localdomain (185.174.17.62.zt.hu. [185.174.17.62]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5dc724055e5sm11559997a12.45.2025.02.05.04.52.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Feb 2025 04:52:42 -0800 (PST) From: Andras Szemzo To: Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Linus Walleij , Philipp Zabel , Maxime Ripard Cc: Vinod Koul , Kishon Vijay Abraham I , Ulf Hansson , Paul Walmsley , Palmer Dabbelt , Albert Ou , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Florian Fainelli , linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, linux-gpio@vger.kernel.org, linux-pm@vger.kernel.org, linux-riscv@lists.infradead.org Subject: [PATCH v2 08/10] phy: allwinner: add v853 usb phy compatible Date: Wed, 5 Feb 2025 13:52:23 +0100 Message-Id: <20250205125225.1152849-9-szemzo.andras@gmail.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250205125225.1152849-1-szemzo.andras@gmail.com> References: <20250205125225.1152849-1-szemzo.andras@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250205_045244_348737_A943CC96 X-CRM114-Status: GOOD ( 11.38 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org V853 has a dual role USB phy, similar to other Allwinner devices, but with only one phy. Add a compatible for it. Signed-off-by: Andras Szemzo --- drivers/phy/allwinner/phy-sun4i-usb.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/phy/allwinner/phy-sun4i-usb.c b/drivers/phy/allwinner/phy-sun4i-usb.c index 29b8fd4b9351..1610501fb8bb 100644 --- a/drivers/phy/allwinner/phy-sun4i-usb.c +++ b/drivers/phy/allwinner/phy-sun4i-usb.c @@ -1005,6 +1005,15 @@ static const struct sun4i_usb_phy_cfg sun50i_a64_cfg = { .phy0_dual_route = true, }; +static const struct sun4i_usb_phy_cfg sun8i_v853_cfg = { + .num_phys = 1, + .phyctl_offset = REG_PHYCTL_A33, + .dedicated_clocks = true, + .hci_phy_ctl_clear = PHY_CTL_SIDDQ, + .phy0_dual_route = true, + .siddq_in_base = true, +}; + static const struct sun4i_usb_phy_cfg sun50i_h6_cfg = { .num_phys = 4, .phyctl_offset = REG_PHYCTL_A33, @@ -1041,6 +1050,7 @@ static const struct of_device_id sun4i_usb_phy_of_match[] = { .data = &sun50i_a64_cfg}, { .compatible = "allwinner,sun50i-h6-usb-phy", .data = &sun50i_h6_cfg }, { .compatible = "allwinner,sun50i-h616-usb-phy", .data = &sun50i_h616_cfg }, + { .compatible = "allwinner,sun8i-v853-usb-phy", .data = &sun8i_v853_cfg }, { .compatible = "allwinner,suniv-f1c100s-usb-phy", .data = &suniv_f1c100s_cfg }, { }, From patchwork Wed Feb 5 12:52:24 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andras Szemzo X-Patchwork-Id: 13961052 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8024DC02194 for ; Wed, 5 Feb 2025 13:09:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=YoG8hVYz4TnvvWDABGAYP2SIelD0Iu7KGfwoYqZ18U4=; b=l6z8tzt/5UV+b4rDus8aA8+ovL AsPGysfWTfNzow6XYvK1ORRV9FPgC25mS3uZd1Gm23ioqjBBduJjOMmdUbdnzwlO9eQPDmgUy3OMG IWyCDgYXNlpypZsb0zM6CzaO18WLiFjxF24s0SHTvszd2DjR4K3mZ4GU050hZ7TWXBwDQ2kUEMr/R D7en7Y126a/9UifIuL+AgLOz5S/KA5nYGVzxUrabP36/fJqybmt0tIma8SgtoAUxP0NZvCm65dJNO D70rWsqZPc2W6zgi2P1bzH7zVLQIWekxeTh5IETfiq/oL7xyag5iYhReSMb4xp6IDDuXJq2Ar/h5F 3c9wOIgw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tff9m-00000003LU6-26Ah; Wed, 05 Feb 2025 13:09:30 +0000 Received: from mail-ed1-x52d.google.com ([2a00:1450:4864:20::52d]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tfeta-00000003Hvt-47Yy; Wed, 05 Feb 2025 12:52:48 +0000 Received: by mail-ed1-x52d.google.com with SMTP id 4fb4d7f45d1cf-5da12292b67so11086483a12.3; Wed, 05 Feb 2025 04:52:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1738759965; x=1739364765; darn=lists.infradead.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=YoG8hVYz4TnvvWDABGAYP2SIelD0Iu7KGfwoYqZ18U4=; b=L0QzvXbRt4Hp7XAn1wLdab/eqUisURx91OM0TwOSTnstdr9fTbgpdaY45L8Piz/R6f sxA/EiHeqBn1yZm4Jyxt3oVgNjJ9enEL8zPJb6HrAgsoVrKZvh3GTAoXJUhbVn+XDEgk /OG7vWA+9iyOLELiJMmMKRu4IKDbJHii7IKDy2fcZpk2bLuQdgsS6iEXUBR/Aej1LO+H sH5hfmdS6C4iXbR+T7bM1/sYjB36wVbxC7+0cSBvhkc/1bVYd0fi7/c20SecOa9kz9ZS WUjIrrs04X4BZX3nIehQ7naxk8ZEb0OuMeQhK14pMLUr/HGmcxlo++uH75ntjcyKa+Gv ri9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738759965; x=1739364765; 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=YoG8hVYz4TnvvWDABGAYP2SIelD0Iu7KGfwoYqZ18U4=; b=IyC7K8ZL/hWDtYk1EfOr944kaQ4+95WaGgQhw/4mUAp0h4Au0ykFfpbTxuw6Cow7Dq vVyw0KOM+DUzFyLN3G+z+TAyJQln2dTOEcQzFWWBbvq5ckZfTwkmVjD27U5F/7mAczVE z9A3leWgAim4zO1bdABnQ+pEVU6cQJPRiVM6qx3K+rlcACihDCLVMb49GO6ukScHJyLh 52i2aQq2tcTHo0hTj9hEydXOFy/idy2F3k2q+gSAkIzuif92zAnYNQMkGvXGqbAYzwhN fQTvdvp1OagS4E81GftPO2+iM+YePPojaTBZPpS/spHliZSuZEOlr3mM8E2uq4ODTxeZ 3RaQ== X-Forwarded-Encrypted: i=1; AJvYcCVWv4RbJOgtxFhD12Tflonz3B5Z3yHb8h8zdsy2OPZQIqrTzZ2A9Arxr2Yq3jQGXBQHG4+fgPQsZ/3wraqGZGF4@lists.infradead.org, AJvYcCWyOKRzyFjxRvLZV0dXczh9nas9ELsKWYjQAzLl26IlTAXMgca/RqcEGLfyEAzT4Yr183v0LlX7ZhEtEsQ=@lists.infradead.org, AJvYcCXlHZwq1DPzun9KIdM8vz1p3hH8PmW6bb+jz8iTBnsI5XVcxitz/XkqlWxo5D/bkAZsoJClpLEavhCw@lists.infradead.org X-Gm-Message-State: AOJu0YzhJ3qOX/h3lJCW7n+I1NR17eVXeAWuUeLTY3Zf/+fAuDvHmjny TrVRbjY3rrOZnT/YvVOwMs1Oy3e1JhWxl3Std21l12QQnDzI7J+t X-Gm-Gg: ASbGncvpiQFwKC4CCBRhrhRdmGQANJq0wnxObhK3vVBpwvIWN/e7KW0lsgv8A/2erVO D8WKNpDp/gE7IlurSSSmfIhPcEe0LGHsQgxaXt9zK98TG7q8Mveygq/Y297ZhwG9LMirDS9j8rX i2+7MC0sXeWj+yzpTCiIxjYB2OFfVJk7+mx5TgqSMMMvCADHJ/+WoPOaD0+QzyotUr92zUR3DVD Xnezo2qQetTXOtWk23RNEvHGWDiPc4LnzHLpMJOYeM8dHTxPH3ZnxcHIS7Otz2YaKrAsXgwPis7 rNvK3IBNAN8nBSj4BkfzcaQ89DDvJkRy5HlemSG0XIWFiw== X-Google-Smtp-Source: AGHT+IFV2crGV6Kt5Qs/AsnGeLvGasb1MMzV5/UFd5iurjz5GlFbvrNc7Mbr+RRftOyHaZgkc/49BQ== X-Received: by 2002:a05:6402:4486:b0:5dc:74fd:abf1 with SMTP id 4fb4d7f45d1cf-5dcdb728ea9mr7554411a12.15.1738759965146; Wed, 05 Feb 2025 04:52:45 -0800 (PST) Received: from localhost.localdomain (185.174.17.62.zt.hu. [185.174.17.62]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5dc724055e5sm11559997a12.45.2025.02.05.04.52.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Feb 2025 04:52:44 -0800 (PST) From: Andras Szemzo To: Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Linus Walleij , Philipp Zabel , Maxime Ripard Cc: Vinod Koul , Kishon Vijay Abraham I , Ulf Hansson , Paul Walmsley , Palmer Dabbelt , Albert Ou , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Florian Fainelli , linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, linux-gpio@vger.kernel.org, linux-pm@vger.kernel.org, linux-riscv@lists.infradead.org Subject: [PATCH v2 09/10] ARM: dts: sun8i: add DTSI file for V853 Date: Wed, 5 Feb 2025 13:52:24 +0100 Message-Id: <20250205125225.1152849-10-szemzo.andras@gmail.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250205125225.1152849-1-szemzo.andras@gmail.com> References: <20250205125225.1152849-1-szemzo.andras@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250205_045247_027754_83BDED37 X-CRM114-Status: GOOD ( 14.20 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org V853/V851 is a new SoC by Allwinner. Add a basic dtsi file for it. Signed-off-by: Andras Szemzo --- arch/arm/boot/dts/allwinner/sun8i-v853.dtsi | 656 ++++++++++++++++++++ 1 file changed, 656 insertions(+) create mode 100644 arch/arm/boot/dts/allwinner/sun8i-v853.dtsi diff --git a/arch/arm/boot/dts/allwinner/sun8i-v853.dtsi b/arch/arm/boot/dts/allwinner/sun8i-v853.dtsi new file mode 100644 index 000000000000..8b82b8783127 --- /dev/null +++ b/arch/arm/boot/dts/allwinner/sun8i-v853.dtsi @@ -0,0 +1,656 @@ +// SPDX-License-Identifier: (GPL-2.0-only OR MIT) +// Copyright (C) 2024 Andras Szemzo + +#include +#include +#include +#include +#include +#include +#include + +/ { + #address-cells = <1>; + #size-cells = <1>; + + dcxo: dcxo-clk { + compatible = "fixed-clock"; + clock-output-names = "osc24M"; + #clock-cells = <0>; + }; + + cpus { + #address-cells = <1>; + #size-cells = <0>; + + cpu0: cpu@0 { + device_type = "cpu"; + compatible = "arm,cortex-a7","arm,armv7"; + reg = <0>; + clocks = <&ccu CLK_CPU>; + clock-names = "cpu"; + clock-frequency = <912000000>; + clock-latency = <200000>; + cooling-min-level = <5>; + cooling-max-level = <0>; + #cooling-cells = <2>; /* min followed by max */ + dynamic-power-coefficient = <142>; + }; + }; + + pmu { + compatible = "arm,cortex-a7-pmu"; + interrupts = , + ; + interrupt-parent = <&gic>; + }; + + timer { + compatible = "arm,armv7-timer"; + interrupts = , + , + , + ; + clock-frequency = <24000000>; + interrupt-parent = <&gic>; + arm,cpu-registers-not-fw-configured; + arm,no-tick-in-suspend; + }; + + soc { + compatible = "simple-bus"; + ranges; + interrupt-parent = <&gic>; + #address-cells = <1>; + #size-cells = <1>; + dma-noncoherent; + + pio: pinctrl@2000000 { + compatible = "allwinner,sun8i-v853-pinctrl"; + reg = <0x2000000 0x800>; + interrupts = , + , + , + , + , + , + , + ; + clocks = <&ccu CLK_APB0>, <&dcxo>, <&rtc CLK_OSC32K>; + clock-names = "apb", "hosc", "losc"; + gpio-controller; + interrupt-controller; + #gpio-cells = <3>; + #interrupt-cells = <3>; + + /omit-if-no-ref/ + uart0_ph9_pins: uart0-ph9-pins { + pins = "PH9", "PH10"; + function = "uart0"; + allwinner,pinmux = <5>; + }; + + /omit-if-no-ref/ + uart2_pe12_pins: uart2-pe12-pins { + pins = "PE12", "PE13"; + function = "uart2"; + allwinner,pinmux = <6>; + }; + + /omit-if-no-ref/ + dsi_2lane_pins: dsi-2lane-pins { + pins = "PD1", "PD2", "PD3", "PD4", "PD5", "PD6"; + function = "dsi"; + allwinner,pinmux = <5>; + }; + + /omit-if-no-ref/ + spi0_pins: spi0-pins { + pins = "PC0", "PC1", "PC2", "PC3", "PC4", "PC5"; + function = "spi0"; + allwinner,pinmux = <4>; + }; + + /omit-if-no-ref/ + spi3_pins: spi3-pins { + pins = "PH11", "PH12", "PH13", "PH14"; + function = "spi3"; + allwinner,pinmux = <6>; + }; + + /omit-if-no-ref/ + i2c2_ph11_pins: i2c2-ph11-pins { + pins = "PH11", "PH12"; + function = "i2c2"; + allwinner,pinmux = <5>; + }; + + /omit-if-no-ref/ + i2c3_ph13_pins: i2c3-ph13-pins { + pins = "PH13", "PH14"; + function = "i2c3"; + allwinner,pinmux = <5>; + }; + + /omit-if-no-ref/ + mmc0_pins: mmc0-pins { + pins = "PF0", "PF1", "PF2", "PF3", "PF4", "PF5"; + function = "sdc0"; + allwinner,pinmux = <2>; + drive-strength = <30>; + bias-pull-up; + }; + + /omit-if-no-ref/ + mmc1_pins: mmc1-pins { + pins = "PE0", "PE1", "PE2", "PE3", "PE4", "PE5"; + function = "sdc1"; + allwinner,pinmux = <6>; + drive-strength = <30>; + bias-pull-up; + }; + + /omit-if-no-ref/ + rmii_pe_pins: rmii-pe-pins { + pins = "PE0", "PE1", "PE2", "PE3", "PE4", + "PE5", "PE6", "PE7", "PE8", "PE9"; + function = "emac"; + allwinner,pinmux = <3>; + }; + }; + + ccu: clock-controller@2001000 { + compatible = "allwinner,sun8i-v853-ccu"; + reg = <0x2001000 0x1000>; + clocks = <&dcxo>, + <&rtc CLK_IOSC>, + <&rtc CLK_OSC32K>; + clock-names = "hosc", "iosc", "losc"; + #clock-cells = <1>; + #reset-cells = <1>; + }; + + gpadc: adc@2009000 { + compatible = "allwinner,sun20i-d1-gpadc"; + reg = <0x2009000 0x0400>; + clocks = <&ccu CLK_BUS_GPADC>; + resets = <&ccu RST_BUS_GPADC>; + interrupts = ; + status = "disabled"; + #io-channel-cells = <1>; + }; + + i2s0: i2s@2032000 { + compatible = "allwinner,sun50i-r329-i2s"; + reg = <0x2032000 0x1000>; + interrupts = ; + clocks = <&ccu CLK_BUS_I2S0>, + <&ccu CLK_I2S0>; + clock-names = "apb", "mod"; + resets = <&ccu RST_BUS_I2S0>; + dmas = <&dma 3>, <&dma 3>; + dma-names = "rx", "tx"; + status = "disabled"; + #sound-dai-cells = <0>; + }; + + i2s1: i2s@2033000 { + compatible = "allwinner,sun50i-r329-i2s"; + reg = <0x2033000 0x1000>; + interrupts = ; + clocks = <&ccu CLK_BUS_I2S1>, + <&ccu CLK_I2S1>; + clock-names = "apb", "mod"; + resets = <&ccu RST_BUS_I2S1>; + dmas = <&dma 4>, <&dma 4>; + dma-names = "rx", "tx"; + status = "disabled"; + #sound-dai-cells = <0>; + }; + + timer: timer@2050000 { + compatible = "allwinner,sun20i-d1-timer", + "allwinner,sun8i-a23-timer"; + reg = <0x2050000 0xa0>; + interrupts = , + ; + clocks = <&dcxo>; + }; + + wdt: watchdog@20500a0 { + compatible = "allwinner,sun20i-d1-wdt-reset", + "allwinner,sun20i-d1-wdt"; + reg = <0x20500a0 0x20>; + interrupts = ; + clocks = <&dcxo>, <&rtc CLK_OSC32K>; + clock-names = "hosc", "losc"; + status = "reserved"; + }; + + uart0: serial@2500000 { + compatible = "snps,dw-apb-uart"; + reg = <0x2500000 0x400>; + reg-io-width = <4>; + reg-shift = <2>; + interrupts = ; + clocks = <&ccu CLK_BUS_UART0>; + resets = <&ccu RST_BUS_UART0>; + dmas = <&dma 14>, <&dma 14>; + dma-names = "rx", "tx"; + status = "disabled"; + }; + + uart1: serial@2500400 { + compatible = "snps,dw-apb-uart"; + reg = <0x2500400 0x400>; + reg-io-width = <4>; + reg-shift = <2>; + interrupts = ; + clocks = <&ccu CLK_BUS_UART1>; + resets = <&ccu RST_BUS_UART1>; + dmas = <&dma 15>, <&dma 15>; + dma-names = "rx", "tx"; + status = "disabled"; + }; + + uart2: serial@2500800 { + compatible = "snps,dw-apb-uart"; + reg = <0x2500800 0x400>; + reg-io-width = <4>; + reg-shift = <2>; + interrupts = ; + clocks = <&ccu CLK_BUS_UART2>; + resets = <&ccu RST_BUS_UART2>; + dmas = <&dma 16>, <&dma 16>; + dma-names = "rx", "tx"; + status = "disabled"; + }; + + uart3: serial@2500c00 { + compatible = "snps,dw-apb-uart"; + reg = <0x2500c00 0x400>; + reg-io-width = <4>; + reg-shift = <2>; + interrupts = ; + clocks = <&ccu CLK_BUS_UART3>; + resets = <&ccu RST_BUS_UART3>; + dmas = <&dma 17>, <&dma 17>; + dma-names = "rx", "tx"; + status = "disabled"; + }; + + i2c0: i2c@2502000 { + compatible = "allwinner,sun8i-v536-i2c", + "allwinner,sun6i-a31-i2c"; + reg = <0x2502000 0x400>; + interrupts = ; + clocks = <&ccu CLK_BUS_I2C0>; + resets = <&ccu RST_BUS_I2C0>; + dmas = <&dma 43>, <&dma 43>; + dma-names = "rx", "tx"; + status = "disabled"; + #address-cells = <1>; + #size-cells = <0>; + }; + + i2c1: i2c@2502400 { + compatible = "allwinner,sun8i-v536-i2c", + "allwinner,sun6i-a31-i2c"; + reg = <0x2502400 0x400>; + interrupts = ; + clocks = <&ccu CLK_BUS_I2C1>; + resets = <&ccu RST_BUS_I2C1>; + dmas = <&dma 44>, <&dma 44>; + dma-names = "rx", "tx"; + status = "disabled"; + #address-cells = <1>; + #size-cells = <0>; + }; + + i2c2: i2c@2502800 { + compatible = "allwinner,sun8i-v536-i2c", + "allwinner,sun6i-a31-i2c"; + reg = <0x2502800 0x400>; + interrupts = ; + clocks = <&ccu CLK_BUS_I2C2>; + resets = <&ccu RST_BUS_I2C2>; + dmas = <&dma 45>, <&dma 45>; + dma-names = "rx", "tx"; + status = "disabled"; + #address-cells = <1>; + #size-cells = <0>; + }; + + i2c3: i2c@2502c00 { + compatible = "allwinner,sun8i-v536-i2c", + "allwinner,sun6i-a31-i2c"; + reg = <0x2502c00 0x400>; + interrupts = ; + clocks = <&ccu CLK_BUS_I2C3>; + resets = <&ccu RST_BUS_I2C3>; + dmas = <&dma 46>, <&dma 46>; + dma-names = "rx", "tx"; + status = "disabled"; + #address-cells = <1>; + #size-cells = <0>; + }; + + i2c4: i2c@2503000 { + compatible = "allwinner,sun8i-v536-i2c", + "allwinner,sun6i-a31-i2c"; + reg = <0x2503000 0x400>; + interrupts = ; + clocks = <&ccu CLK_BUS_I2C4>; + resets = <&ccu RST_BUS_I2C4>; + dmas = <&dma 47>, <&dma 47>; + dma-names = "rx", "tx"; + status = "disabled"; + #address-cells = <1>; + #size-cells = <0>; + }; + + syscon: syscon@3000000 { + compatible = "allwinner,sun8i-h3-system-control"; + reg = <0x3000000 0x1000>; + ranges; + #address-cells = <1>; + #size-cells = <1>; + + sram_c: sram@20000 { + compatible = "mmio-sram"; + reg = <0x00020000 0x21000>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0 0x00020000 0x21000>; + + ve_sram: sram-section@0 { + compatible = "allwinner,sun8i-v3s-sram-c", + "allwinner,sun4i-a10-sram-c1"; + reg = <0x000000 0x21000>; + }; + }; + }; + + dma: dma-controller@3002000 { + compatible = "allwinner,sun20i-d1-dma"; + reg = <0x3002000 0x1000>; + interrupts = ; + clocks = <&ccu CLK_BUS_DMA>, <&ccu CLK_MBUS_DMA>; + clock-names = "bus", "mbus"; + resets = <&ccu RST_BUS_DMA>; + dma-channels = <16>; + dma-requests = <48>; + #dma-cells = <1>; + }; + + hwspinlock: hwlock@3005000 { + compatible = "allwinner,sun6i-a31-hwspinlock"; + reg = <0x3005000 0x1000>; + clocks = <&ccu CLK_BUS_SPINLOCK>; + clock-names = "ahb"; + resets = <&ccu RST_BUS_SPINLOCK>; + reset-names = "ahb"; + interrupts = ; + }; + + sid: efuse@3006000 { + compatible = "allwinner,sun20i-d1-sid"; + reg = <0x3006000 0x1000>; + #address-cells = <1>; + #size-cells = <1>; + + ths_calib: ths-calib@14 { + reg = <0x14 0x8>; + }; + }; + + hstimer@3008000 { + compatible = "allwinner,sun7i-a20-hstimer"; + reg = <0x03008000 0x1000>; + interrupts = , + ; + clocks = <&ccu CLK_BUS_HSTIMER>; + }; + + gic: interrupt-controller@3021000 { + compatible = "arm,gic-400"; + reg = <0x03021000 0x1000>, /* GIC Dist */ + <0x03022000 0x2000>, /* GIC CPU */ + <0x03024000 0x2000>, /* GIC VCPU Control */ + <0x03026000 0x2000>; /* GIC VCPU */ + interrupts = ; + interrupt-controller; + #interrupt-cells = <3>; + }; + + mbus: dram-controller@3102000 { + compatible = "allwinner,sun20i-d1-mbus"; + reg = <0x3102000 0x1000>, + <0x3103000 0x1000>; + reg-names = "mbus", "dram"; + interrupts = ; + clocks = <&ccu CLK_MBUS>, + <&ccu CLK_DRAM>, + <&ccu CLK_BUS_DRAM>; + clock-names = "mbus", "dram", "bus"; + dma-ranges = <0 0x40000000 0x80000000>; + #address-cells = <1>; + #size-cells = <1>; + #interconnect-cells = <1>; + }; + + mmc0: mmc@4020000 { + compatible = "allwinner,sun20i-d1-mmc"; + reg = <0x4020000 0x1000>; + interrupts = ; + clocks = <&ccu CLK_BUS_MMC0>, <&ccu CLK_MMC0>; + clock-names = "ahb", "mmc"; + resets = <&ccu RST_BUS_MMC0>; + reset-names = "ahb"; + no-sdio; + no-mmc; + cap-sd-highspeed; + max-frequency = <150000000>; + mmc-ddr-1_8v; + status = "disabled"; + #address-cells = <1>; + #size-cells = <0>; + }; + + mmc1: mmc@4021000 { + compatible = "allwinner,sun20i-d1-mmc"; + reg = <0x4021000 0x1000>; + interrupts = ; + clocks = <&ccu CLK_BUS_MMC1>, <&ccu CLK_MMC1>; + clock-names = "ahb", "mmc"; + resets = <&ccu RST_BUS_MMC1>; + reset-names = "ahb"; + cap-sd-highspeed; + cap-mmc-highspeed; + max-frequency = <150000000>; + mmc-ddr-1_8v; + status = "disabled"; + #address-cells = <1>; + #size-cells = <0>; + }; + + mmc2: mmc@4022000 { + compatible = "allwinner,sun20i-d1-mmc"; + reg = <0x4022000 0x1000>; + interrupts = ; + clocks = <&ccu CLK_BUS_MMC2>, <&ccu CLK_MMC2>; + clock-names = "ahb", "mmc"; + resets = <&ccu RST_BUS_MMC2>; + reset-names = "ahb"; + no-sdio; + no-sd; + cap-mmc-highspeed; + max-frequency = <150000000>; + mmc-ddr-1_8v; + mmc-ddr-3_3v; + status = "disabled"; + #address-cells = <1>; + #size-cells = <0>; + }; + + spi0: spi@4025000 { + compatible = "allwinner,sun50i-r329-spi"; + reg = <0x4025000 0x1000>; + interrupts = ; + clocks = <&ccu CLK_BUS_SPI0>, <&ccu CLK_SPI0>; + clock-names = "ahb", "mod"; + resets = <&ccu RST_BUS_SPI0>; + dmas = <&dma 22>, <&dma 22>; + dma-names = "rx", "tx"; + num-cs = <1>; + status = "disabled"; + #address-cells = <1>; + #size-cells = <0>; + }; + + spi1: spi@4026000 { + compatible = "allwinner,sun50i-r329-spi-dbi", + "allwinner,sun50i-r329-spi"; + reg = <0x4026000 0x1000>; + interrupts = ; + clocks = <&ccu CLK_BUS_SPI1>, <&ccu CLK_SPI1>; + clock-names = "ahb", "mod"; + resets = <&ccu RST_BUS_SPI1>; + dmas = <&dma 23>, <&dma 23>; + dma-names = "rx", "tx"; + num-cs = <1>; + status = "disabled"; + #address-cells = <1>; + #size-cells = <0>; + }; + + spi2: spi@4027000 { + compatible = "allwinner,sun50i-r329-spi"; + reg = <0x4027000 0x1000>; + interrupts = ; + clocks = <&ccu CLK_BUS_SPI2>, <&ccu CLK_SPI2>; + clock-names = "ahb", "mod"; + resets = <&ccu RST_BUS_SPI2>; + dmas = <&dma 24>, <&dma 24>; + dma-names = "rx", "tx"; + num-cs = <1>; + status = "disabled"; + #address-cells = <1>; + #size-cells = <0>; + }; + + spi3: spi@4028000 { + compatible = "allwinner,sun50i-r329-spi"; + reg = <0x4028000 0x1000>; + interrupts = ; + clocks = <&ccu CLK_BUS_SPI3>, <&ccu CLK_SPI3>; + clock-names = "ahb", "mod"; + resets = <&ccu RST_BUS_SPI3>; + dmas = <&dma 25>, <&dma 25>; + dma-names = "rx", "tx"; + num-cs = <1>; + status = "disabled"; + #address-cells = <1>; + #size-cells = <0>; + }; + + usb_otg: usb@4100000 { + compatible = "allwinner,sun8i-a33-musb"; + reg = <0x4100000 0x400>; + interrupts = ; + interrupt-names = "mc"; + clocks = <&ccu CLK_BUS_OTG>; + resets = <&ccu RST_BUS_OTG>; + extcon = <&usbphy 0>; + phys = <&usbphy 0>; + phy-names = "usb"; + status = "disabled"; + }; + + usbphy: phy@4100400 { + compatible = "allwinner,sun8i-v853-usb-phy"; + reg = <0x4100400 0x100>, + <0x4101800 0x100>; + reg-names = "phy_ctrl", + "pmu0"; + clocks = <&ccu CLK_USB_OHCI>; + clock-names = "usb0_phy"; + resets = <&ccu RST_USB_PHY>; + reset-names = "usb0_reset"; + status = "disabled"; + #phy-cells = <1>; + }; + + ehci0: usb@4101000 { + compatible = "generic-ehci"; + reg = <0x4101000 0x100>; + interrupts = ; + clocks = <&ccu CLK_BUS_OHCI>, + <&ccu CLK_BUS_EHCI>, + <&ccu CLK_USB_OHCI>; + resets = <&ccu RST_BUS_OHCI>, + <&ccu RST_BUS_EHCI>; + phys = <&usbphy 0>; + phy-names = "usb"; + status = "disabled"; + }; + + ohci0: usb@4101400 { + compatible = "generic-ohci"; + reg = <0x4101400 0x100>; + interrupts = ; + clocks = <&ccu CLK_BUS_OHCI>, + <&ccu CLK_USB_OHCI>; + resets = <&ccu RST_BUS_OHCI>; + phys = <&usbphy 0>; + phy-names = "usb"; + status = "disabled"; + }; + + ppu: power-controller@7001000 { + compatible = "allwinner,sun8i-v853-ppu"; + reg = <0x7001000 0x400>; + clocks = <&r_ccu CLK_BUS_R_PPU>; + resets = <&r_ccu RST_BUS_R_PPU>; + #power-domain-cells = <1>; + }; + + r_ccu: clock-controller@7010000 { + compatible = "allwinner,sun8i-v853-r-ccu"; + reg = <0x7010000 0x230>; + clocks = <&dcxo>, + <&rtc CLK_IOSC>, + <&rtc CLK_OSC32K>, + <&ccu CLK_PLL_PERIPH_200M>, + <&ccu CLK_PLL_AUDIO_4X>; + clock-names = "hosc", + "iosc", + "losc", + "pll-periph", + "pll-audio"; + #clock-cells = <1>; + #reset-cells = <1>; + }; + + nmi_intc: intc-nmi@7010320 { + compatible = "allwinner,sun9i-a80-nmi"; + interrupt-parent = <&gic>; + #interrupt-cells = <2>; + #address-cells = <0>; + interrupt-controller; + reg = <0x07010320 0xc>; + interrupts = ; + }; + + rtc: rtc@7090000 { + compatible = "allwinner,sun50i-r329-rtc"; + reg = <0x7090000 0x400>; + interrupts = ; + clocks = <&r_ccu CLK_BUS_R_RTC>; + clock-names = "bus"; + resets = <&r_ccu RST_BUS_R_RTC>; + wakeup-source; + #clock-cells = <1>; + }; + }; +}; From patchwork Wed Feb 5 12:52:25 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andras Szemzo X-Patchwork-Id: 13961053 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 28AD0C02194 for ; Wed, 5 Feb 2025 13:11:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=lyEbgL/DE3XaQNmV45jqJ+6PRNx/4WLm+5/Q7HMMYbM=; b=w/TNwHO8MuolRoVqCG94sfXVnP c4ptjS7L3WhMtNGVlAbqPAusk8+VHbZr19eq7bFaemvyKRxeX3VgozDp0XAK4RIizKTfihHTL3iEq eGYPGlzCgejQa+6CGKvJFIFYj98fRSty3oXNT8XuKwKRD9GXQ3zwf2yCvhTyuarlpIXRkSngwdAgO qZxpjKd4aMSBUYOn6AgbtmnH6hPa5Wy/F0GRTa34sGe60rDrBtM47fBTpgFtO7ixmsrYGZKp6Ldj3 xKDHjsXbOMzNtenJ41MJdjkY8yfcIT+I4L1v3cL3NugLEFJImPowTHJtuI8nsKfsOq6/K8I7X8hww Ft1183iA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tffB8-00000003Lj8-0J8q; Wed, 05 Feb 2025 13:10:54 +0000 Received: from mail-ed1-x533.google.com ([2a00:1450:4864:20::533]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tfetd-00000003HxF-0S07; Wed, 05 Feb 2025 12:52:50 +0000 Received: by mail-ed1-x533.google.com with SMTP id 4fb4d7f45d1cf-5d982de9547so13147714a12.2; Wed, 05 Feb 2025 04:52:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1738759968; x=1739364768; darn=lists.infradead.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=lyEbgL/DE3XaQNmV45jqJ+6PRNx/4WLm+5/Q7HMMYbM=; b=gXMIcYqmz5QqLUiq3Ky1Czrye2a1bdZmcxf13S1I2i1dHPFHBhLRr2//wMrcsxH5xW /CrFQVM7/DahEsPCuky7Y8EbXTuK8HVG40Qz0SYHYrqtNuO12lROWVB2130m8XpIpw4G abxuRLkWc0+07J/rXi5ddQhLotAulJ/lNbmlERvlRYR5nIKigNsNrsUdVbtL5bTlz6vm B/iNmwzxSV/nCzutQ1YPrg4t5QycXPnk5mls4deBbGvizrAYrXygoq4S3lx0JNGXX3SC yjW5jxhRzs4OO6RdGyuQWNDstA91QNJTmnxNr6xqrOAZk9QWzCSoWX1UZGtonCAAtWl3 q70w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738759968; x=1739364768; 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=lyEbgL/DE3XaQNmV45jqJ+6PRNx/4WLm+5/Q7HMMYbM=; b=kVVjbkW6XkF3xE/jWbRq6fZRmBha8+eW4aZ7UaCBj4wI/M7GcgDvtKippF3oqSVSlC xeJy4t022Xs1TZactmhiy0ERJEFkvYNepqki3hwkL85IT4HdhjRoHmA+kkKO68oxOYCN MW52EGY71AEllQ54MMcJM+C4lVHBHn7YGuDCgoKigce5kWCFMADloW3OZ0jr9HZay57o j66HBxky1No5s2lJBPQKFrG5KOY6unI39aEINQq9009myYj1Q3J+L5CxusEVZdhdFPwl uc9ukKgJO9B6UWUffMlfaVl4Xtsl6CreCXM2QFnNuQTYDG9Hu0AyQEEhAMkPdk/+4R/3 U/uQ== X-Forwarded-Encrypted: i=1; AJvYcCUV5sQV2N70BYpOwfsN29jXa5LsgR5QDLOi/s19B4P999Srqh+Z8vzNnEhFqbpTWNLlMkMAff0+jpmwcd6KUTNg@lists.infradead.org, AJvYcCVGtQSXqKysX4GizqdXt3FpHsR63IqvC59VHBTY0AKNrd7F07jCxFYQe7ilT8U5jHJm+u6ZXfN2xDos@lists.infradead.org, AJvYcCWYvc7ge7L9F94NTSlaM3ZLOWxGyMXq4jOh6PgXRhKIBTQ3RtCozQIzN1Cl/dQ/7XGaQJTIWfw3f/Z83mA=@lists.infradead.org X-Gm-Message-State: AOJu0YyhAgadbA/qsSL4SmbYVrmiamcIlFVs13XqON9oAaCMjOC2Fq5X 8WLrvfn/h1cf/2dlE6SxbAPKEjFA1XKr/u38TfDNk5bzNBFK4Cq/ X-Gm-Gg: ASbGncvGbjKFpT+5bzdxqblQ5mYsP773v5+ortGDt211TEHqc/Xck7G9RXru+hmf8Ly Cs5JFBccMdwcKo0u7ZV4IPCLWG011ItY/Fuu9lZR+Ndriiwe5qDWusCRPrwlavZLnz8hc9kxQMB NsimqMq0YVfR8nlVWYHGknInWXWhevzhKUSITkAjT1zGsj5opUgQ91yEsvxepGXn300gjf+Kgnl GWyciMy2OYRqTuWYrPiO0umNCsDhJ2fQDAtlOK+lzGeCOfwzymo8qVpSiCM0+fvTqDAz+sIbSmx 1tjNcKFkSGsuNo5UW+IX4QXz7F/OncUi7IIOWJLutA5hdw== X-Google-Smtp-Source: AGHT+IETUIvDkqTKdY7k2714QPYM3xUPceBcb2unO/nI5NYhZ4IV4FRiMa6FjOclLKPwMVNHsxzJ0A== X-Received: by 2002:a05:6402:358d:b0:5d0:cfad:f6c with SMTP id 4fb4d7f45d1cf-5dcdb764604mr2738652a12.21.1738759967460; Wed, 05 Feb 2025 04:52:47 -0800 (PST) Received: from localhost.localdomain (185.174.17.62.zt.hu. [185.174.17.62]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5dc724055e5sm11559997a12.45.2025.02.05.04.52.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Feb 2025 04:52:46 -0800 (PST) From: Andras Szemzo To: Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Linus Walleij , Philipp Zabel , Maxime Ripard Cc: Vinod Koul , Kishon Vijay Abraham I , Ulf Hansson , Paul Walmsley , Palmer Dabbelt , Albert Ou , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Florian Fainelli , linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, linux-gpio@vger.kernel.org, linux-pm@vger.kernel.org, linux-riscv@lists.infradead.org Subject: [PATCH v2 10/10] ARM: dts: sun8i: add DTS file for yuzuki-lizard V851s Date: Wed, 5 Feb 2025 13:52:25 +0100 Message-Id: <20250205125225.1152849-11-szemzo.andras@gmail.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250205125225.1152849-1-szemzo.andras@gmail.com> References: <20250205125225.1152849-1-szemzo.andras@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250205_045249_154306_08F13FF4 X-CRM114-Status: GOOD ( 15.89 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Yuzuki-lizard is an Open Hardware board based on Allwinner V851s SoC. Add a basic dts for it. Signed-off-by: Andras Szemzo --- arch/arm/boot/dts/allwinner/Makefile | 1 + .../boot/dts/allwinner/sun8i-v851s-lizard.dts | 196 ++++++++++++++++++ 2 files changed, 197 insertions(+) create mode 100644 arch/arm/boot/dts/allwinner/sun8i-v851s-lizard.dts diff --git a/arch/arm/boot/dts/allwinner/Makefile b/arch/arm/boot/dts/allwinner/Makefile index 48666f73e638..af84073f6a51 100644 --- a/arch/arm/boot/dts/allwinner/Makefile +++ b/arch/arm/boot/dts/allwinner/Makefile @@ -260,6 +260,7 @@ dtb-$(CONFIG_MACH_SUN8I) += \ sun8i-v3-sl631-imx179.dtb \ sun8i-v3s-anbernic-rg-nano.dtb \ sun8i-v3s-licheepi-zero.dtb \ + sun8i-v851s-lizard.dtb \ sun8i-v3s-licheepi-zero-dock.dtb \ sun8i-v40-bananapi-m2-berry.dtb dtb-$(CONFIG_MACH_SUN9I) += \ diff --git a/arch/arm/boot/dts/allwinner/sun8i-v851s-lizard.dts b/arch/arm/boot/dts/allwinner/sun8i-v851s-lizard.dts new file mode 100644 index 000000000000..180d10b1a06a --- /dev/null +++ b/arch/arm/boot/dts/allwinner/sun8i-v851s-lizard.dts @@ -0,0 +1,196 @@ +// SPDX-License-Identifier: (GPL-2.0-only OR MIT) +// Copyright (C) 2024 Andras Szemzo.andras@gmail.com> + +/dts-v1/; +#include +#include +#include "sun8i-v853.dtsi" + +/ { + model = "Yuzuki-lizard"; + compatible = "yuzukihd,lizard", "allwinner,sun8i-v853", "allwinner,sun8i"; + + aliases { + serial0 = &uart0; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + memory { + reg = <0x40000000 0x4000000>; + }; + + reg_vcc: vcc { + compatible = "regulator-fixed"; + regulator-name = "vcc"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + }; + + reg_vcc_1v8: vcc-1v8 { + compatible = "regulator-fixed"; + regulator-name = "vcc-1v8"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + }; + + reg_usbvbus: usbvbus { + compatible = "regulator-fixed"; + regulator-name = "usbvbus"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + vin-supply = <®_vcc>; + }; + + reg_vcc_3v3: vcc-3v3 { + compatible = "regulator-fixed"; + regulator-name = "vcc-3v3"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + vin-supply = <®_vcc>; + }; + + reg_vdd_cpu: vdd-cpu { + compatible = "regulator-fixed"; + regulator-name = "vdd-cpu"; + regulator-min-microvolt = <900000>; + regulator-max-microvolt = <900000>; + vin-supply = <®_vcc>; + }; + + leds { + compatible = "gpio-leds"; + + status_led { + linux,default-trigger = "heartbeat"; + label = "led:red"; + gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; + }; + }; + + wifi_pwrseq: wifi-pwrseq { + compatible = "mmc-pwrseq-simple"; + reset-gpios = <&pio 4 6 GPIO_ACTIVE_LOW>; /* PE6 */ + }; +}; + +&dcxo { + clock-frequency = <24000000>; +}; + +&cpu0 { + cpu-supply = <®_vdd_cpu>; +}; + +&pio { + vcc-pa-supply = <®_vcc_3v3>; + vcc-pc-supply = <®_vcc_3v3>; + vcc-pd-supply = <®_vcc_3v3>; + vcc-pe-supply = <®_vcc_3v3>; + vcc-pf-supply = <®_vcc_3v3>; + vcc-ph-supply = <®_vcc_3v3>; +}; + +&uart0 { + pinctrl-0 = <&uart0_ph9_pins>; + pinctrl-names = "default"; + status = "okay"; +}; + +&wdt { + status = "okay"; +}; + +&spi0 { + pinctrl-0 = <&spi0_pins>; + pinctrl-names = "default"; + status = "okay"; + + flash@0 { + compatible = "spi-nand"; + spi-max-frequency = <75000000>; + reg = <0>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "awboot"; + reg = <0x00000000 0x00020000>; /* 128K */ + }; + + partition@20000 { + label = "dtb"; + reg = <0x00020000 0x00020000>; /* 128k */ + }; + + partition@40000 { + label = "kernel"; + reg = <0x00040000 0x00800000>; /* 8MB */ + }; + + partition@840000 { + label = "rootfs"; + reg = <0x00840000 0x077c0000>; + }; + }; + }; +}; + +&i2c2 { + pinctrl-0 = <&i2c2_ph11_pins>; + pinctrl-names = "default"; + status = "okay"; +}; + +&mmc0 { + bus-width = <4>; + broken-cd; + disable-wp; + vmmc-supply = <®_vcc_3v3>; + vqmmc-supply = <®_vcc_3v3>; + pinctrl-0 = <&mmc0_pins>; + pinctrl-names = "default"; + status = "okay"; +}; + +&mmc1 { + bus-width = <4>; + mmc-pwrseq = <&wifi_pwrseq>; + non-removable; + vmmc-supply = <®_vcc_3v3>; + vqmmc-supply = <®_vcc_3v3>; + pinctrl-0 = <&mmc1_pins>; + pinctrl-names = "default"; + status = "okay"; + + xr829: wifi@1 { + reg = <1>; + interrupt-parent = <&pio>; + interrupts = <4 7 IRQ_TYPE_LEVEL_HIGH>; /* PE7 */ + interrupt-names = "host-wake"; + }; +}; + +&usb_otg { + dr_mode = "otg"; + status = "okay"; +}; + +&ehci0 { + status = "okay"; +}; + +&ohci0 { + status = "okay"; +}; + +&usbphy { + usb0_vbus-supply = <®_usbvbus>; + usb0_id_det-gpio = <&pio 4 9 GPIO_ACTIVE_LOW>; + status = "okay"; +};