From patchwork Tue Dec 3 13:41:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Wilczynski X-Patchwork-Id: 847185 Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 51A301F1305 for ; Tue, 3 Dec 2024 13:41:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.118.77.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733233321; cv=none; b=RWxXtCSP4zmjdwngL6xdgYzFumuJ2jiIKgPhHfBX9/F0IiGDFKtD8ZlXk18gEexfNTnAsxcN/GQC0E6MuPBFqMsPDJeY5xBudtgoUTPX1dobqXJnT+Y58TrsDzAHZ2ITjeo42uwnl3BhmFXxCFr+t+pz5wZAo5JXFQkX+MoQL7Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733233321; c=relaxed/simple; bh=0gOfd9dZt9MGufLYogl+fZTyCnDVj3RbDJk5/Sde4zI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:MIME-Version: Content-Type:References; b=e2GSUqhYcEYa0GoYZ5NNSnYuXv/aFHuleGNEHzPlpJwVivPQn2w6c6pzl4NaVCnYIN9K2sTTr0zEIz4nDJ/+C/OfPtGLF/ltnQSQ3Ck1u3aHaemtmi+OyWWtJncjh0nefe3yw5jHMq+dFtGFCL0kcq+//J1KzxRKvvn9vmOfAMM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com; spf=pass smtp.mailfrom=samsung.com; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b=HeNOLIqk; arc=none smtp.client-ip=210.118.77.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=samsung.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="HeNOLIqk" Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20241203134151euoutp0146ffb213954fb2be5e9633e7b8d887c7~NroN9arC_2554425544euoutp01O for ; Tue, 3 Dec 2024 13:41:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20241203134151euoutp0146ffb213954fb2be5e9633e7b8d887c7~NroN9arC_2554425544euoutp01O DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1733233311; bh=An2FnGzhZlzxYk3d0KbYBPV10vyvjEv9yIWGJmCixm4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HeNOLIqkLv/QP391hSBIUly3/90IicaVVj90K3Hz3OWDPmnlQMXps1dk8HiIXfL8P GHOE+B6QcMp0W1xzKzl/TzwC8U05hphL4lITFjy2dRY4KPSt5GVd2HHnXO3+FX8t+H UrYKRevC6ThyYc5gMVwWqEcCQcMMj9n+/S7lojdk= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20241203134150eucas1p25a85460ccafd9ed5d7d22b8d8d8ae598~NroNXDkru2018620186eucas1p26; Tue, 3 Dec 2024 13:41:50 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 26.51.20397.E9A0F476; Tue, 3 Dec 2024 13:41:50 +0000 (GMT) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20241203134150eucas1p24ba8d2fbf2af5b8f9abe503b4334127d~NroM69Jq52020120201eucas1p2T; Tue, 3 Dec 2024 13:41:50 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20241203134150eusmtrp1889f2361b76d63d4267f624abc7c4a20~NroMzQkh_0887308873eusmtrp1E; Tue, 3 Dec 2024 13:41:50 +0000 (GMT) X-AuditID: cbfec7f5-ed1d670000004fad-25-674f0a9e7821 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 04.F6.19654.D9A0F476; Tue, 3 Dec 2024 13:41:49 +0000 (GMT) Received: from AMDC4942.home (unknown [106.210.136.40]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20241203134148eusmtip2682121417cbbd74031114cca8880e1e2~NroLd3eh02944429444eusmtip2M; Tue, 3 Dec 2024 13:41:48 +0000 (GMT) From: Michal Wilczynski To: mturquette@baylibre.com, sboyd@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, drew@pdp7.com, guoren@kernel.org, wefu@redhat.com, jassisinghbrar@gmail.com, paul.walmsley@sifive.com, palmer@dabbelt.com, aou@eecs.berkeley.edu, frank.binns@imgtec.com, matt.coster@imgtec.com, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, simona@ffwll.ch, ulf.hansson@linaro.org, jszhang@kernel.org, m.szyprowski@samsung.com Cc: linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, dri-devel@lists.freedesktop.org, linux-pm@vger.kernel.org, Michal Wilczynski Subject: [RFC PATCH v1 01/14] clk: thead: Refactor TH1520 clock driver to share common code Date: Tue, 3 Dec 2024 14:41:24 +0100 Message-Id: <20241203134137.2114847-2-m.wilczynski@samsung.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241203134137.2114847-1-m.wilczynski@samsung.com> Precedence: bulk X-Mailing-List: linux-pm@vger.kern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EwfjIUYJDmYlEd7l673ThXhTEiurUovy44tKc1KLDzGa Ap09kVlKNDkfmNrySuINzQxMDU3MLA1MLc2MlcR52a6cTxMSSE8sSc1OTS1ILYLpY+LglGpg 2tQ9od1WsPyQb2TF1y67re0vdv+ZLXyWY0nRavEr2UeDP1t/keAz+7NucUr8pYequfL/J8e2 uGzWtQkJq9915mOb7GKf2vWPdBqlMicwlm1gPDCjT79S/OiPNdwhfDY/Hrn5n0uezZJu8yxE fSLXXdsP9YrZmeyXvaZZzFJ203gZv2CR0fTyKRN3p9duuqwr4210xHjqscfVJxdo/66/+jXh knCNeKKIs4i5HseFwkAXhuxz854wHOERkf7AMvv5v80mgo/XB/Lft+hPepngKvq2NFpyxd9i s0z7ZJWD23Y2f6t9G9OYuCNINSX/zhzVe1u69WNzdR14A3g9leMlPuwPazVXWp1VKP72hJwS S3FGoqEWc1FxIgAVcv9xtQMAAA== X-CMS-MailID: 20241203134150eucas1p24ba8d2fbf2af5b8f9abe503b4334127d X-Msg-Generator: CA X-RootMTR: 20241203134150eucas1p24ba8d2fbf2af5b8f9abe503b4334127d X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20241203134150eucas1p24ba8d2fbf2af5b8f9abe503b4334127d References: <20241203134137.2114847-1-m.wilczynski@samsung.com> The T-Head TH1520 SoC includes various clocks for different subsystems like Application Processor (AP) and Video Output (VO) [1]. Currently, the clock driver only implements AP clocks. Since the programming interface for these clocks is identical across subsystems, refactor the code to move common functions into clk-th1520.c. This prepares the driver to support VO clocks by reducing code duplication and improving maintainability. No functional changes are introduced with this refactoring. Link: https://openbeagle.org/beaglev-ahead/beaglev-ahead/-/blob/main/docs/TH1520%20System%20User%20Manual.pdf [1] Signed-off-by: Michal Wilczynski --- MAINTAINERS | 2 +- drivers/clk/thead/Makefile | 2 +- drivers/clk/thead/clk-th1520-ap.c | 301 +----------------------------- drivers/clk/thead/clk-th1520.c | 188 +++++++++++++++++++ drivers/clk/thead/clk-th1520.h | 134 +++++++++++++ 5 files changed, 326 insertions(+), 301 deletions(-) create mode 100644 drivers/clk/thead/clk-th1520.c create mode 100644 drivers/clk/thead/clk-th1520.h diff --git a/MAINTAINERS b/MAINTAINERS index 1e930c7a58b1..7c85abf1dd1e 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -20188,7 +20188,7 @@ F: Documentation/devicetree/bindings/mailbox/thead,th1520-mbox.yaml F: Documentation/devicetree/bindings/net/thead,th1520-gmac.yaml F: Documentation/devicetree/bindings/pinctrl/thead,th1520-pinctrl.yaml F: arch/riscv/boot/dts/thead/ -F: drivers/clk/thead/clk-th1520-ap.c +F: drivers/clk/thead/ F: drivers/mailbox/mailbox-th1520.c F: drivers/net/ethernet/stmicro/stmmac/dwmac-thead.c F: drivers/pinctrl/pinctrl-th1520.c diff --git a/drivers/clk/thead/Makefile b/drivers/clk/thead/Makefile index 7ee0bec1f251..d7cf88390b69 100644 --- a/drivers/clk/thead/Makefile +++ b/drivers/clk/thead/Makefile @@ -1,2 +1,2 @@ # SPDX-License-Identifier: GPL-2.0 -obj-$(CONFIG_CLK_THEAD_TH1520_AP) += clk-th1520-ap.o +obj-$(CONFIG_CLK_THEAD_TH1520_AP) += clk-th1520.o clk-th1520-ap.o diff --git a/drivers/clk/thead/clk-th1520-ap.c b/drivers/clk/thead/clk-th1520-ap.c index 17e32ae08720..a6015805b859 100644 --- a/drivers/clk/thead/clk-th1520-ap.c +++ b/drivers/clk/thead/clk-th1520-ap.c @@ -5,297 +5,9 @@ * Authors: Yangtao Li */ -#include -#include -#include -#include -#include -#include -#include - -#define TH1520_PLL_POSTDIV2 GENMASK(26, 24) -#define TH1520_PLL_POSTDIV1 GENMASK(22, 20) -#define TH1520_PLL_FBDIV GENMASK(19, 8) -#define TH1520_PLL_REFDIV GENMASK(5, 0) -#define TH1520_PLL_BYPASS BIT(30) -#define TH1520_PLL_DSMPD BIT(24) -#define TH1520_PLL_FRAC GENMASK(23, 0) -#define TH1520_PLL_FRAC_BITS 24 - -struct ccu_internal { - u8 shift; - u8 width; -}; - -struct ccu_div_internal { - u8 shift; - u8 width; - u32 flags; -}; - -struct ccu_common { - int clkid; - struct regmap *map; - u16 cfg0; - u16 cfg1; - struct clk_hw hw; -}; - -struct ccu_mux { - struct ccu_internal mux; - struct ccu_common common; -}; - -struct ccu_gate { - u32 enable; - struct ccu_common common; -}; - -struct ccu_div { - u32 enable; - struct ccu_div_internal div; - struct ccu_internal mux; - struct ccu_common common; -}; - -struct ccu_pll { - struct ccu_common common; -}; - -#define TH_CCU_ARG(_shift, _width) \ - { \ - .shift = _shift, \ - .width = _width, \ - } - -#define TH_CCU_DIV_FLAGS(_shift, _width, _flags) \ - { \ - .shift = _shift, \ - .width = _width, \ - .flags = _flags, \ - } - -#define CCU_GATE(_clkid, _struct, _name, _parent, _reg, _gate, _flags) \ - struct ccu_gate _struct = { \ - .enable = _gate, \ - .common = { \ - .clkid = _clkid, \ - .cfg0 = _reg, \ - .hw.init = CLK_HW_INIT_PARENTS_DATA( \ - _name, \ - _parent, \ - &clk_gate_ops, \ - _flags), \ - } \ - } - -static inline struct ccu_common *hw_to_ccu_common(struct clk_hw *hw) -{ - return container_of(hw, struct ccu_common, hw); -} - -static inline struct ccu_mux *hw_to_ccu_mux(struct clk_hw *hw) -{ - struct ccu_common *common = hw_to_ccu_common(hw); - - return container_of(common, struct ccu_mux, common); -} - -static inline struct ccu_pll *hw_to_ccu_pll(struct clk_hw *hw) -{ - struct ccu_common *common = hw_to_ccu_common(hw); +#include "clk-th1520.h" - return container_of(common, struct ccu_pll, common); -} - -static inline struct ccu_div *hw_to_ccu_div(struct clk_hw *hw) -{ - struct ccu_common *common = hw_to_ccu_common(hw); - - return container_of(common, struct ccu_div, common); -} - -static inline struct ccu_gate *hw_to_ccu_gate(struct clk_hw *hw) -{ - struct ccu_common *common = hw_to_ccu_common(hw); - - return container_of(common, struct ccu_gate, common); -} - -static u8 ccu_get_parent_helper(struct ccu_common *common, - struct ccu_internal *mux) -{ - unsigned int val; - u8 parent; - - regmap_read(common->map, common->cfg0, &val); - parent = val >> mux->shift; - parent &= GENMASK(mux->width - 1, 0); - - return parent; -} - -static int ccu_set_parent_helper(struct ccu_common *common, - struct ccu_internal *mux, - u8 index) -{ - return regmap_update_bits(common->map, common->cfg0, - GENMASK(mux->width - 1, 0) << mux->shift, - index << mux->shift); -} - -static void ccu_disable_helper(struct ccu_common *common, u32 gate) -{ - if (!gate) - return; - regmap_update_bits(common->map, common->cfg0, - gate, ~gate); -} - -static int ccu_enable_helper(struct ccu_common *common, u32 gate) -{ - unsigned int val; - int ret; - - if (!gate) - return 0; - - ret = regmap_update_bits(common->map, common->cfg0, gate, gate); - regmap_read(common->map, common->cfg0, &val); - return ret; -} - -static int ccu_is_enabled_helper(struct ccu_common *common, u32 gate) -{ - unsigned int val; - - if (!gate) - return true; - - regmap_read(common->map, common->cfg0, &val); - return val & gate; -} - -static unsigned long ccu_div_recalc_rate(struct clk_hw *hw, - unsigned long parent_rate) -{ - struct ccu_div *cd = hw_to_ccu_div(hw); - unsigned long rate; - unsigned int val; - - regmap_read(cd->common.map, cd->common.cfg0, &val); - val = val >> cd->div.shift; - val &= GENMASK(cd->div.width - 1, 0); - rate = divider_recalc_rate(hw, parent_rate, val, NULL, - cd->div.flags, cd->div.width); - - return rate; -} - -static u8 ccu_div_get_parent(struct clk_hw *hw) -{ - struct ccu_div *cd = hw_to_ccu_div(hw); - - return ccu_get_parent_helper(&cd->common, &cd->mux); -} - -static int ccu_div_set_parent(struct clk_hw *hw, u8 index) -{ - struct ccu_div *cd = hw_to_ccu_div(hw); - - return ccu_set_parent_helper(&cd->common, &cd->mux, index); -} - -static void ccu_div_disable(struct clk_hw *hw) -{ - struct ccu_div *cd = hw_to_ccu_div(hw); - - ccu_disable_helper(&cd->common, cd->enable); -} - -static int ccu_div_enable(struct clk_hw *hw) -{ - struct ccu_div *cd = hw_to_ccu_div(hw); - - return ccu_enable_helper(&cd->common, cd->enable); -} - -static int ccu_div_is_enabled(struct clk_hw *hw) -{ - struct ccu_div *cd = hw_to_ccu_div(hw); - - return ccu_is_enabled_helper(&cd->common, cd->enable); -} - -static const struct clk_ops ccu_div_ops = { - .disable = ccu_div_disable, - .enable = ccu_div_enable, - .is_enabled = ccu_div_is_enabled, - .get_parent = ccu_div_get_parent, - .set_parent = ccu_div_set_parent, - .recalc_rate = ccu_div_recalc_rate, - .determine_rate = clk_hw_determine_rate_no_reparent, -}; - -static unsigned long th1520_pll_vco_recalc_rate(struct clk_hw *hw, - unsigned long parent_rate) -{ - struct ccu_pll *pll = hw_to_ccu_pll(hw); - unsigned long div, mul, frac; - unsigned int cfg0, cfg1; - u64 rate = parent_rate; - - regmap_read(pll->common.map, pll->common.cfg0, &cfg0); - regmap_read(pll->common.map, pll->common.cfg1, &cfg1); - - mul = FIELD_GET(TH1520_PLL_FBDIV, cfg0); - div = FIELD_GET(TH1520_PLL_REFDIV, cfg0); - if (!(cfg1 & TH1520_PLL_DSMPD)) { - mul <<= TH1520_PLL_FRAC_BITS; - frac = FIELD_GET(TH1520_PLL_FRAC, cfg1); - mul += frac; - div <<= TH1520_PLL_FRAC_BITS; - } - rate = parent_rate * mul; - rate = rate / div; - return rate; -} - -static unsigned long th1520_pll_postdiv_recalc_rate(struct clk_hw *hw, - unsigned long parent_rate) -{ - struct ccu_pll *pll = hw_to_ccu_pll(hw); - unsigned long div, rate = parent_rate; - unsigned int cfg0, cfg1; - - regmap_read(pll->common.map, pll->common.cfg0, &cfg0); - regmap_read(pll->common.map, pll->common.cfg1, &cfg1); - - if (cfg1 & TH1520_PLL_BYPASS) - return rate; - - div = FIELD_GET(TH1520_PLL_POSTDIV1, cfg0) * - FIELD_GET(TH1520_PLL_POSTDIV2, cfg0); - - rate = rate / div; - - return rate; -} - -static unsigned long ccu_pll_recalc_rate(struct clk_hw *hw, - unsigned long parent_rate) -{ - unsigned long rate = parent_rate; - - rate = th1520_pll_vco_recalc_rate(hw, rate); - rate = th1520_pll_postdiv_recalc_rate(hw, rate); - - return rate; -} - -static const struct clk_ops clk_pll_ops = { - .recalc_rate = ccu_pll_recalc_rate, -}; +#define NR_CLKS (CLK_UART_SCLK + 1) static const struct clk_parent_data osc_24m_clk[] = { { .index = 0 } @@ -956,15 +668,6 @@ static struct ccu_common *th1520_gate_clks[] = { &sram3_clk.common, }; -#define NR_CLKS (CLK_UART_SCLK + 1) - -static const struct regmap_config th1520_clk_regmap_config = { - .reg_bits = 32, - .val_bits = 32, - .reg_stride = 4, - .fast_io = true, -}; - static int th1520_clk_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; diff --git a/drivers/clk/thead/clk-th1520.c b/drivers/clk/thead/clk-th1520.c new file mode 100644 index 000000000000..e2bfe56de9af --- /dev/null +++ b/drivers/clk/thead/clk-th1520.c @@ -0,0 +1,188 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2023 Jisheng Zhang + * Copyright (C) 2023 Vivo Communication Technology Co. Ltd. + * Authors: Yangtao Li + */ + +#include "clk-th1520.h" + +static u8 ccu_get_parent_helper(struct ccu_common *common, + struct ccu_internal *mux) +{ + unsigned int val; + u8 parent; + + regmap_read(common->map, common->cfg0, &val); + parent = val >> mux->shift; + parent &= GENMASK(mux->width - 1, 0); + + return parent; +} + +static int ccu_set_parent_helper(struct ccu_common *common, + struct ccu_internal *mux, u8 index) +{ + return regmap_update_bits(common->map, common->cfg0, + GENMASK(mux->width - 1, 0) << mux->shift, + index << mux->shift); +} + +static void ccu_disable_helper(struct ccu_common *common, u32 gate) +{ + if (!gate) + return; + regmap_update_bits(common->map, common->cfg0, gate, ~gate); +} + +static int ccu_enable_helper(struct ccu_common *common, u32 gate) +{ + unsigned int val; + int ret; + + if (!gate) + return 0; + + ret = regmap_update_bits(common->map, common->cfg0, gate, gate); + regmap_read(common->map, common->cfg0, &val); + return ret; +} + +static int ccu_is_enabled_helper(struct ccu_common *common, u32 gate) +{ + unsigned int val; + + if (!gate) + return true; + + regmap_read(common->map, common->cfg0, &val); + return val & gate; +} + +static unsigned long ccu_div_recalc_rate(struct clk_hw *hw, + unsigned long parent_rate) +{ + struct ccu_div *cd = hw_to_ccu_div(hw); + unsigned long rate; + unsigned int val; + + regmap_read(cd->common.map, cd->common.cfg0, &val); + val = val >> cd->div.shift; + val &= GENMASK(cd->div.width - 1, 0); + rate = divider_recalc_rate(hw, parent_rate, val, NULL, cd->div.flags, + cd->div.width); + + return rate; +} + +static u8 ccu_div_get_parent(struct clk_hw *hw) +{ + struct ccu_div *cd = hw_to_ccu_div(hw); + + return ccu_get_parent_helper(&cd->common, &cd->mux); +} + +static int ccu_div_set_parent(struct clk_hw *hw, u8 index) +{ + struct ccu_div *cd = hw_to_ccu_div(hw); + + return ccu_set_parent_helper(&cd->common, &cd->mux, index); +} + +static void ccu_div_disable(struct clk_hw *hw) +{ + struct ccu_div *cd = hw_to_ccu_div(hw); + + ccu_disable_helper(&cd->common, cd->enable); +} + +static int ccu_div_enable(struct clk_hw *hw) +{ + struct ccu_div *cd = hw_to_ccu_div(hw); + + return ccu_enable_helper(&cd->common, cd->enable); +} + +static int ccu_div_is_enabled(struct clk_hw *hw) +{ + struct ccu_div *cd = hw_to_ccu_div(hw); + + return ccu_is_enabled_helper(&cd->common, cd->enable); +} + +const struct clk_ops ccu_div_ops = { + .disable = ccu_div_disable, + .enable = ccu_div_enable, + .is_enabled = ccu_div_is_enabled, + .get_parent = ccu_div_get_parent, + .set_parent = ccu_div_set_parent, + .recalc_rate = ccu_div_recalc_rate, + .determine_rate = clk_hw_determine_rate_no_reparent, +}; + +static unsigned long th1520_pll_vco_recalc_rate(struct clk_hw *hw, + unsigned long parent_rate) +{ + struct ccu_pll *pll = hw_to_ccu_pll(hw); + unsigned long div, mul, frac; + unsigned int cfg0, cfg1; + u64 rate = parent_rate; + + regmap_read(pll->common.map, pll->common.cfg0, &cfg0); + regmap_read(pll->common.map, pll->common.cfg1, &cfg1); + + mul = FIELD_GET(TH1520_PLL_FBDIV, cfg0); + div = FIELD_GET(TH1520_PLL_REFDIV, cfg0); + if (!(cfg1 & TH1520_PLL_DSMPD)) { + mul <<= TH1520_PLL_FRAC_BITS; + frac = FIELD_GET(TH1520_PLL_FRAC, cfg1); + mul += frac; + div <<= TH1520_PLL_FRAC_BITS; + } + rate = parent_rate * mul; + rate = rate / div; + return rate; +} + +static unsigned long th1520_pll_postdiv_recalc_rate(struct clk_hw *hw, + unsigned long parent_rate) +{ + struct ccu_pll *pll = hw_to_ccu_pll(hw); + unsigned long div, rate = parent_rate; + unsigned int cfg0, cfg1; + + regmap_read(pll->common.map, pll->common.cfg0, &cfg0); + regmap_read(pll->common.map, pll->common.cfg1, &cfg1); + + if (cfg1 & TH1520_PLL_BYPASS) + return rate; + + div = FIELD_GET(TH1520_PLL_POSTDIV1, cfg0) * + FIELD_GET(TH1520_PLL_POSTDIV2, cfg0); + + rate = rate / div; + + return rate; +} + +static unsigned long ccu_pll_recalc_rate(struct clk_hw *hw, + unsigned long parent_rate) +{ + unsigned long rate = parent_rate; + + rate = th1520_pll_vco_recalc_rate(hw, rate); + rate = th1520_pll_postdiv_recalc_rate(hw, rate); + + return rate; +} + +const struct clk_ops clk_pll_ops = { + .recalc_rate = ccu_pll_recalc_rate, +}; + +const struct regmap_config th1520_clk_regmap_config = { + .reg_bits = 32, + .val_bits = 32, + .reg_stride = 4, + .fast_io = true, +}; diff --git a/drivers/clk/thead/clk-th1520.h b/drivers/clk/thead/clk-th1520.h new file mode 100644 index 000000000000..285d41e65008 --- /dev/null +++ b/drivers/clk/thead/clk-th1520.h @@ -0,0 +1,134 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2023 Jisheng Zhang + * Copyright (C) 2023 Vivo Communication Technology Co. Ltd. + * Authors: Yangtao Li + * + * clk-th1520.h - Common definitions for T-HEAD TH1520 Clock Drivers + */ + +#ifndef CLK_TH1520_H +#define CLK_TH1520_H + +#include +#include +#include +#include +#include +#include +#include + +#define TH1520_PLL_POSTDIV2 GENMASK(26, 24) +#define TH1520_PLL_POSTDIV1 GENMASK(22, 20) +#define TH1520_PLL_FBDIV GENMASK(19, 8) +#define TH1520_PLL_REFDIV GENMASK(5, 0) +#define TH1520_PLL_BYPASS BIT(30) +#define TH1520_PLL_DSMPD BIT(24) +#define TH1520_PLL_FRAC GENMASK(23, 0) +#define TH1520_PLL_FRAC_BITS 24 + +struct ccu_internal { + u8 shift; + u8 width; +}; + +struct ccu_div_internal { + u8 shift; + u8 width; + u32 flags; +}; + +struct ccu_common { + int clkid; + struct regmap *map; + u16 cfg0; + u16 cfg1; + struct clk_hw hw; +}; + +struct ccu_mux { + struct ccu_internal mux; + struct ccu_common common; +}; + +struct ccu_gate { + u32 enable; + struct ccu_common common; +}; + +struct ccu_div { + u32 enable; + struct ccu_div_internal div; + struct ccu_internal mux; + struct ccu_common common; +}; + +struct ccu_pll { + struct ccu_common common; +}; + +#define TH_CCU_ARG(_shift, _width) \ + { \ + .shift = _shift, \ + .width = _width, \ + } + +#define TH_CCU_DIV_FLAGS(_shift, _width, _flags) \ + { \ + .shift = _shift, \ + .width = _width, \ + .flags = _flags, \ + } + +#define CCU_GATE(_clkid, _struct, _name, _parent, _reg, _gate, _flags) \ + struct ccu_gate _struct = { \ + .enable = _gate, \ + .common = { \ + .clkid = _clkid, \ + .cfg0 = _reg, \ + .hw.init = CLK_HW_INIT_PARENTS_DATA( \ + _name, \ + _parent, \ + &clk_gate_ops, \ + _flags), \ + } \ + } + +static inline struct ccu_common *hw_to_ccu_common(struct clk_hw *hw) +{ + return container_of(hw, struct ccu_common, hw); +} + +static inline struct ccu_mux *hw_to_ccu_mux(struct clk_hw *hw) +{ + struct ccu_common *common = hw_to_ccu_common(hw); + + return container_of(common, struct ccu_mux, common); +} + +static inline struct ccu_pll *hw_to_ccu_pll(struct clk_hw *hw) +{ + struct ccu_common *common = hw_to_ccu_common(hw); + + return container_of(common, struct ccu_pll, common); +} + +static inline struct ccu_div *hw_to_ccu_div(struct clk_hw *hw) +{ + struct ccu_common *common = hw_to_ccu_common(hw); + + return container_of(common, struct ccu_div, common); +} + +static inline struct ccu_gate *hw_to_ccu_gate(struct clk_hw *hw) +{ + struct ccu_common *common = hw_to_ccu_common(hw); + + return container_of(common, struct ccu_gate, common); +} + +extern const struct clk_ops ccu_div_ops; +extern const struct clk_ops clk_pll_ops; +extern const struct regmap_config th1520_clk_regmap_config; + +#endif /* CLK_TH1520_H */ From patchwork Tue Dec 3 13:41:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Wilczynski X-Patchwork-Id: 847184 Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5390A1F12F1 for ; Tue, 3 Dec 2024 13:42:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.118.77.12 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733233325; cv=none; b=OTQ50SVDboOaIBC3DfaL8rGk7Plh4eeU7wmgQl6Gb76WyCcj5BUPReCxYYJfs8MUSVWq41K+XWYSrIieV8AeTBsxdEmPYMgF/UnnqWH8Pd5MEcl8YtbJ+F91VLtk7oPO8uEaB0JjB5MeaN52nYzJ2YO6VhsMFMArgbydtKM1ckM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733233325; c=relaxed/simple; bh=OGLtTxbpTtXaSRXv6pLjTlt1O9CEipR68uf6gA8hz4A=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:MIME-Version: Content-Type:References; b=HsaNeiuMPMNzvokOxARWJCyNfj/QHQjzKjaz59eR0aE04kR9XZBtc4ONnSQ6oqdr6eKY+UBq4KTBnbkjxwr/ffU5Or+9i0HqJIJB/nxsHQ6FO5YJTQgiLwsJWiPglOu+Zdos7Y6k5Pyst7bRF0UBDx23VZzDz4gRZeJz3V178uU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com; spf=pass smtp.mailfrom=samsung.com; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b=cfkNzmB3; arc=none smtp.client-ip=210.118.77.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=samsung.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="cfkNzmB3" Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20241203134152euoutp025759033c94724a121c19d3c729384003~NroPB3oE33035030350euoutp02L for ; Tue, 3 Dec 2024 13:41:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20241203134152euoutp025759033c94724a121c19d3c729384003~NroPB3oE33035030350euoutp02L DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1733233312; bh=+XIFXNOuRC/rcFhjLbJmehyyVGJ3vIOum8KvaMBq9LI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cfkNzmB3x86Z2xSbjTLmvnC8O8eNK0nCs/UNO4hXeR43ZlTbIL8JsQv/uTHAUl91Y +GovTpLFSZ6ecaGS6Qa/AwM2iAqiDMHUfKFRbIJDCFEmXe5OUR2FUoPI4XMagJYtGY DmsK14Sx30SPI5xxyxFTq4jaT9ZT7LPBrAGDaeLk= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20241203134151eucas1p1bbd536f1e8d6d8946eb144dedbb9445d~NroObdrzt2130621306eucas1p1F; Tue, 3 Dec 2024 13:41:51 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 3F.7F.20409.F9A0F476; Tue, 3 Dec 2024 13:41:51 +0000 (GMT) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20241203134151eucas1p18edf7fb37cd8f30983a559d7481f560b~NroN-p4wm2535425354eucas1p1Z; Tue, 3 Dec 2024 13:41:51 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20241203134151eusmtrp207114ab96da6efa994f6550edf24126f~NroN9FfPc3025130251eusmtrp2H; Tue, 3 Dec 2024 13:41:51 +0000 (GMT) X-AuditID: cbfec7f4-c0df970000004fb9-78-674f0a9f0ccf Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 48.C8.19920.F9A0F476; Tue, 3 Dec 2024 13:41:51 +0000 (GMT) Received: from AMDC4942.home (unknown [106.210.136.40]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20241203134149eusmtip22891f5955fca0861755c99081618733c~NroMrXVOB3010130101eusmtip2U; Tue, 3 Dec 2024 13:41:49 +0000 (GMT) From: Michal Wilczynski To: mturquette@baylibre.com, sboyd@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, drew@pdp7.com, guoren@kernel.org, wefu@redhat.com, jassisinghbrar@gmail.com, paul.walmsley@sifive.com, palmer@dabbelt.com, aou@eecs.berkeley.edu, frank.binns@imgtec.com, matt.coster@imgtec.com, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, simona@ffwll.ch, ulf.hansson@linaro.org, jszhang@kernel.org, m.szyprowski@samsung.com Cc: linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, dri-devel@lists.freedesktop.org, linux-pm@vger.kernel.org, Michal Wilczynski Subject: [RFC PATCH v1 02/14] dt-bindings: clock: thead,th1520: Rename header file Date: Tue, 3 Dec 2024 14:41:25 +0100 Message-Id: <20241203134137.2114847-3-m.wilczynski@samsung.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241203134137.2114847-1-m.wilczynski@samsung.com> Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA01Se0xTZxzNd+/tvbfNCpfSxE9gYe2ibi7AaAx8RAMuUXITlgBGAllGtJPL IzzTwthwDwwPgZUNF4laqwVEy4odGY9aWDsGIy1S7ZxsUDJB4iSuyCA8xeFg1Fs3/zu/8zvn O7+TfDQu6SSD6JyCYk5VoMyTkyLCbH/qCtOLErPePmuLQMPjLRjq2dBS6LrNhSH9kEuApu52 Y+jX1QUSfTtzh0J/2k4RaKztEoUq7B0k8minSLSomRKg0T4diZbrhwAyL1eSyDQ0SaGOVT2G mhd7CNRq6QOouvaaAP0ychh5RjU4qtb6oy2rhUKbY98R6OJ8P4W6584IkMOUiir7zxIHX2UX 3FUUO+fxEOxPNSsUa1trIthe7STFanpvAbbTWEuy98asJHv5ZjJ7/wsHxna1fs5WmuwYu/DD byT7ZbcRsHcrxim2y3kyKeA90YEMLi/nQ04VEXtclH2mNa3o9msfXa0cFpQDS3AdENKQ2Qf/ abxD1AERLWHaAFw1DWD8sAJgo75PwA/LAI65f6deWDb+mKb4hQFA3dQVn2UOwJahHwmvimQU cNqgf26XMo9x6F6dIL0DzjwC0PxQR3pVgcxRuLZZjnkxweyCW2Yt8GIxEwdPb93H+LxQ2D9w G/diIXMQPm6sE/CaAHjzwsPnafi2pqLnIu4NgIxJBK/XPCF48yG4Puf2PRQIZx3dvhIhcKtX 7+ML4XTPEs7jT2CvxuHD++E919/bh9LbAW/Cjr4Inn4H2hdchJeGjB90/xXAn+AHvzafw3la DGuqJbx6N2zU1P8X6moz+0JZOKubAA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J/PCpIQEehkkXi7eS0jiMMs8JZR4vrMjWDt wgJBElum/WAHsVkEVCX+b5vFCGLzCthLtP+/zwSxQl5i/8GzzCA2p4CDxOupXawgthBQzY6/ h1kh6gUlTs58AjaTGai+eets5gmMArOQpGYhSS1gZFrFKJJaWpybnltsqFecmFtcmpeul5yf u4kRmFa2Hfu5eQfjvFcf9Q4xMnEwHmKU4GBWEuFdvt47XYg3JbGyKrUoP76oNCe1+BCjKdDd E5mlRJPzgYktryTe0MzA1NDEzNLA1NLMWEmc1+3y+TQhgfTEktTs1NSC1CKYPiYOTqkGJp/J 4g1S7XLrdypwFZ0sOJDXsWntDev/ziIJbx1n/1r8luGhXsmHhZ2rP+SemXpw+2VHh8bJyZsX aR8SsZyilyAaJ/3a4cZNDlGHhXkTvrncFDUN/6K+xv/inQm7y9f3MC4W3mTwsO/4k5lNTeWq RU2b+467q120fiFmc95d8Y1tZ7tit/LhefG/bdZzaT/peaoppsHAcq1/usrFF1EW9ze/z0rS X3vq0Pyfb7UchFNdbv3dFj/jWtCFlRf/HpbLLr1vOuHCgtm/DXI8H0sEd1Seznx22uu9zFrn 6canjeyiV5bOnFj4V3byr76JtwSSVRecnZS4INXiGe/6DV8f/v7uJ8D7h+fSx0NPpWPWzHqn xFKckWioxVxUnAgAGT2kN7QDAAA= X-CMS-MailID: 20241203134151eucas1p18edf7fb37cd8f30983a559d7481f560b X-Msg-Generator: CA X-RootMTR: 20241203134151eucas1p18edf7fb37cd8f30983a559d7481f560b X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20241203134151eucas1p18edf7fb37cd8f30983a559d7481f560b References: <20241203134137.2114847-1-m.wilczynski@samsung.com> As support for clocks from new subsystems is being added to the T-Head TH1520 SoC, the header file name should reflect this broader scope. The existing header file 'thead,th1520-clk-ap.h' includes the '-ap' suffix, indicating it's specific to the Application Processor (AP) subsystem. Rename the header file to 'thead,th1520-clk.h' to generalize it for all subsystems. Update all references to this header file accordingly. Signed-off-by: Michal Wilczynski --- .../devicetree/bindings/clock/thead,th1520-clk-ap.yaml | 4 ++-- .../devicetree/bindings/mailbox/thead,th1520-mbox.yaml | 2 +- MAINTAINERS | 2 +- arch/riscv/boot/dts/thead/th1520.dtsi | 2 +- drivers/clk/thead/clk-th1520.h | 2 +- .../clock/{thead,th1520-clk-ap.h => thead,th1520-clk.h} | 0 6 files changed, 6 insertions(+), 6 deletions(-) rename include/dt-bindings/clock/{thead,th1520-clk-ap.h => thead,th1520-clk.h} (100%) diff --git a/Documentation/devicetree/bindings/clock/thead,th1520-clk-ap.yaml b/Documentation/devicetree/bindings/clock/thead,th1520-clk-ap.yaml index 0129bd0ba4b3..4a0806af2bf9 100644 --- a/Documentation/devicetree/bindings/clock/thead,th1520-clk-ap.yaml +++ b/Documentation/devicetree/bindings/clock/thead,th1520-clk-ap.yaml @@ -32,7 +32,7 @@ properties: "#clock-cells": const: 1 description: - See for valid indices. + See for valid indices. required: - compatible @@ -44,7 +44,7 @@ additionalProperties: false examples: - | - #include + #include clock-controller@ef010000 { compatible = "thead,th1520-clk-ap"; reg = <0xef010000 0x1000>; diff --git a/Documentation/devicetree/bindings/mailbox/thead,th1520-mbox.yaml b/Documentation/devicetree/bindings/mailbox/thead,th1520-mbox.yaml index 0971fb97896e..0b58b8d0d351 100644 --- a/Documentation/devicetree/bindings/mailbox/thead,th1520-mbox.yaml +++ b/Documentation/devicetree/bindings/mailbox/thead,th1520-mbox.yaml @@ -68,7 +68,7 @@ additionalProperties: false examples: - | - #include + #include soc { #address-cells = <2>; #size-cells = <2>; diff --git a/MAINTAINERS b/MAINTAINERS index 7c85abf1dd1e..bd4bbf07d588 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -20192,7 +20192,7 @@ F: drivers/clk/thead/ F: drivers/mailbox/mailbox-th1520.c F: drivers/net/ethernet/stmicro/stmmac/dwmac-thead.c F: drivers/pinctrl/pinctrl-th1520.c -F: include/dt-bindings/clock/thead,th1520-clk-ap.h +F: include/dt-bindings/clock/thead,th1520-clk.h RNBD BLOCK DRIVERS M: Md. Haris Iqbal diff --git a/arch/riscv/boot/dts/thead/th1520.dtsi b/arch/riscv/boot/dts/thead/th1520.dtsi index acfe030e803a..dc2d554b4a71 100644 --- a/arch/riscv/boot/dts/thead/th1520.dtsi +++ b/arch/riscv/boot/dts/thead/th1520.dtsi @@ -5,7 +5,7 @@ */ #include -#include +#include / { compatible = "thead,th1520"; diff --git a/drivers/clk/thead/clk-th1520.h b/drivers/clk/thead/clk-th1520.h index 285d41e65008..5d30f55e88a1 100644 --- a/drivers/clk/thead/clk-th1520.h +++ b/drivers/clk/thead/clk-th1520.h @@ -10,7 +10,7 @@ #ifndef CLK_TH1520_H #define CLK_TH1520_H -#include +#include #include #include #include diff --git a/include/dt-bindings/clock/thead,th1520-clk-ap.h b/include/dt-bindings/clock/thead,th1520-clk.h similarity index 100% rename from include/dt-bindings/clock/thead,th1520-clk-ap.h rename to include/dt-bindings/clock/thead,th1520-clk.h From patchwork Tue Dec 3 13:41:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Wilczynski X-Patchwork-Id: 847533 Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 67E881F4276 for ; Tue, 3 Dec 2024 13:42:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.118.77.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733233323; cv=none; b=WZloiQ6zQj7GjO4iXEW5x/JW5sdIMqVF4rMZ779hlDHzrVcbR/XpZrUlngVIaKYkYffSXzbAm/GoBJydt70pxwJs1jlz9kcnKm9MhtuRr7TWkMfyY1v3KRFLn+rnd1fJ6KUMm3WmRkyl9wOKbsRfsXsDDEUWbOMkj5RQLf4agX0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733233323; c=relaxed/simple; bh=ezUoqy9EyI7rlqtGoj2nKxRNVdz0UudgIDnN7YVZeeg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:MIME-Version: Content-Type:References; b=Ne0bEgvC7YAAy2ti8fQddfJHAzGRWKdG+oMHJUtpjlHlsRLH/EVlOWOqRQocaC3hxGCgkcpZd0z7WMvuA/gX8zbq14cvt1neupjp5m8fP9/m9c+7j30/njm/8PT2zodPUh+Mj53+W2+G179xzxD2KiiKpnXwgIJcRYQcsI/06cU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com; spf=pass smtp.mailfrom=samsung.com; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b=U5d1BHZK; arc=none smtp.client-ip=210.118.77.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=samsung.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="U5d1BHZK" Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20241203134153euoutp014883803fd70d70d105804ef88d85eddf~NroQFlAL02570425704euoutp01E for ; Tue, 3 Dec 2024 13:41:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20241203134153euoutp014883803fd70d70d105804ef88d85eddf~NroQFlAL02570425704euoutp01E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1733233313; bh=a88yTuKc0U8ya5XZYE8bq3AQdSOHV1kDfujITRvdz+U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=U5d1BHZKJNrxvWKS37T6NyxZKQgiKL7c/D4nIHzWwwfTeEixx4fJhYbYQe+Yr6i7l Mgys5OHwUwhA2Y2L4zDf+T243G4AV7QZhQNTjNnrX0222n6PGjB4FQSr/N7mCs8QDk DtnaxxDqXklpHnERC6wtUdNxKQuWvhoDxklNvUeY= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20241203134153eucas1p2eb472062c8d3c2e55fd6c337a04d3931~NroPq-ZAP2017220172eucas1p24; Tue, 3 Dec 2024 13:41:53 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id B1.CA.20821.1AA0F476; Tue, 3 Dec 2024 13:41:53 +0000 (GMT) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20241203134152eucas1p1ed480afaf4d7de3a4a706477e709b6fd~NroPMLKEF1743017430eucas1p1Z; Tue, 3 Dec 2024 13:41:52 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20241203134152eusmtrp1e7991a53db793011b255982f7216e896~NroPLY6vw0888908889eusmtrp1-; Tue, 3 Dec 2024 13:41:52 +0000 (GMT) X-AuditID: cbfec7f2-b11c470000005155-63-674f0aa166ca Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id A7.F6.19654.0AA0F476; Tue, 3 Dec 2024 13:41:52 +0000 (GMT) Received: from AMDC4942.home (unknown [106.210.136.40]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20241203134151eusmtip27b7ed05ed073adc14202b77624744963~NroN5kQhD2454624546eusmtip2J; Tue, 3 Dec 2024 13:41:51 +0000 (GMT) From: Michal Wilczynski To: mturquette@baylibre.com, sboyd@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, drew@pdp7.com, guoren@kernel.org, wefu@redhat.com, jassisinghbrar@gmail.com, paul.walmsley@sifive.com, palmer@dabbelt.com, aou@eecs.berkeley.edu, frank.binns@imgtec.com, matt.coster@imgtec.com, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, simona@ffwll.ch, ulf.hansson@linaro.org, jszhang@kernel.org, m.szyprowski@samsung.com Cc: linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, dri-devel@lists.freedesktop.org, linux-pm@vger.kernel.org, Michal Wilczynski Subject: [RFC PATCH v1 03/14] clk: thead: Enable clock gates with regmaps Date: Tue, 3 Dec 2024 14:41:26 +0100 Message-Id: <20241203134137.2114847-4-m.wilczynski@samsung.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241203134137.2114847-1-m.wilczynski@samsung.com> Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA01SfUxbVRz19r2+9+goe5QBN/vItHGLm5GBQb3TukFEfcwlMBOjMyyzgWcB +djasaFiYHwVunbZwII8mB0LgQ7GiAMaYDAGEkqtNNIhoJYPl46vMZGxjs4hCn1M99/5nd85 95xfcilM0khsphJSTrDKFHmSlBDhpt5HtpcqRVGK4IUKCvUNXxKg5sccia502ATI0GMTojF7 kwANuuYJdPXOTySa7jiNoyHjBRLl9DYQaIYbI9CCdkyIbrVVEGhR1wOQaTGXQPU9oyRqcBkE qHKhGUdVLW0A5RdWC9HAD2+jmVtaDOVzG9E/7S0kWhn6Dkflf3SSqGnuvBCZ6z9EuZ1f42Hb mPmRPJKZm5nBme8LHpBMx8OLONPKjZKMtvVHwFyrLSQYx1A7wXxrOcSMnzELmMaqTCa3vlfA zN/4mWDONtUCxp4zTDKN1i+jfT8WyeLYpISTrHLPvk9E8ct1Y+Sxe/7pRc6zeBb41VcDvChI h8Kp8/OkBogoCW0E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2jZP4XFQdbj/Y1Wdo83L1+yeBzu+MLusffb AhaPnbPusnv07DzD6LFpVSebx51re9g85p0M9LjffZzJY/OSeo+WtceYPN7vu8rm0bdlFaPH pebr7B6bT1cHCEbp2RTll5akKmTkF5fYKkUbWhjpGVpa6BmZWOoZGpvHWhmZKunb2aSk5mSW pRbp2yXoZfxZfY+94K1oxaQnfSwNjLcEuxg5OSQETCRmt09l7mLk4hASWMoosXr3JXaIhIzE te6XLBC2sMSfa11sEEWvGCU+7uxnBkmwCRhJPFg+nxUkISLQySLxdvNaRhCHWeAto8T1mRvB 2oUFPCWOP9oPZrMIqEo0HZgP1s0rYC+x+147E8QKeYn9B8+CxTkFHCReT+1iBbGFgGp2/D3M ClEvKHFy5hOwOcxA9c1bZzNPYBSYhSQ1C0lqASPTKkaR1NLi3PTcYiO94sTc4tK8dL3k/NxN jMDEsu3Yzy07GFe++qh3iJGJg/EQowQHs5II7/L13ulCvCmJlVWpRfnxRaU5qcWHGE2B7p7I LCWanA9MbXkl8YZmBqaGJmaWBqaWZsZK4rxsV86nCQmkJ5akZqemFqQWwfQxcXBKNTDVhLqy PnWujjyx5UH0qmP3/z9clHzo2d37klkPy82alIWPK+85Mp9JfY1+zZScSyxm8r5MR2VY5gmX zuyvX/5T5I+Zs9qrDY/cM7W8DvB5WJ3+mfRV6dSiV6Iul48V8D34JmZ48nzczBexGx74Ti/4 vmn1ZEbm30cvb1/DUTrx1Repexml13izD06cPikuK8/+Xlql8UbJlQxrjBnTAk5snrXozjXf qKeRFtcbOfSuKjlpz1f+wGkX18sWL77043P+TNMU+UlNDxZPCHKI3CPBKrDLqPL27CML+FIU jITW/KpJN+tZXccssOG5akkFs1hJUtmfRvctay3zvH/EbpgtqpsRkcRT/tvmY1xLbIkSS3FG oqEWc1FxIgBpGSjwtQMAAA== X-CMS-MailID: 20241203134152eucas1p1ed480afaf4d7de3a4a706477e709b6fd X-Msg-Generator: CA X-RootMTR: 20241203134152eucas1p1ed480afaf4d7de3a4a706477e709b6fd X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20241203134152eucas1p1ed480afaf4d7de3a4a706477e709b6fd References: <20241203134137.2114847-1-m.wilczynski@samsung.com> The current implementation of the CCU_GATE macro assumes direct access to memory-mapped registers, which isn't suitable when using regmaps for register access. In the TH1520 SoC, the address space for the VO (Video Output) subsystem clocks is shared with other control registers, such as those used for resetting the GPU. To prevent conflicts and ensure synchronized access, it's important to access these registers via a regmap. This patch updates the CCU_GATE macro to support regmap-based access by reusing the clk_ops from the divider clocks (ccu_div_ops). This change allows the clock gates to be controlled through regmap, enabling proper synchronization when multiple components interact with the shared address space. Signed-off-by: Michal Wilczynski --- drivers/clk/thead/clk-th1520.c | 10 ++++++++-- drivers/clk/thead/clk-th1520.h | 15 +++++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/drivers/clk/thead/clk-th1520.c b/drivers/clk/thead/clk-th1520.c index e2bfe56de9af..3ada8b98bd8e 100644 --- a/drivers/clk/thead/clk-th1520.c +++ b/drivers/clk/thead/clk-th1520.c @@ -120,8 +120,14 @@ const struct clk_ops ccu_div_ops = { .determine_rate = clk_hw_determine_rate_no_reparent, }; -static unsigned long th1520_pll_vco_recalc_rate(struct clk_hw *hw, - unsigned long parent_rate) +const struct clk_ops ccu_gate_ops = { + .disable = ccu_div_disable, + .enable = ccu_div_enable, + .is_enabled = ccu_div_is_enabled, +}; + +unsigned long th1520_pll_vco_recalc_rate(struct clk_hw *hw, + unsigned long parent_rate) { struct ccu_pll *pll = hw_to_ccu_pll(hw); unsigned long div, mul, frac; diff --git a/drivers/clk/thead/clk-th1520.h b/drivers/clk/thead/clk-th1520.h index 5d30f55e88a1..532afbbfea01 100644 --- a/drivers/clk/thead/clk-th1520.h +++ b/drivers/clk/thead/clk-th1520.h @@ -94,6 +94,20 @@ struct ccu_pll { } \ } +#define CCU_GATE_REGMAP(_clkid, _struct, _name, _parent, _reg, _gate, _flags) \ + struct ccu_gate _struct = { \ + .enable = _gate, \ + .common = { \ + .clkid = _clkid, \ + .cfg0 = _reg, \ + .hw.init = CLK_HW_INIT_PARENTS_DATA( \ + _name, \ + _parent, \ + &ccu_gate_ops, \ + _flags), \ + } \ + } + static inline struct ccu_common *hw_to_ccu_common(struct clk_hw *hw) { return container_of(hw, struct ccu_common, hw); @@ -130,5 +144,6 @@ static inline struct ccu_gate *hw_to_ccu_gate(struct clk_hw *hw) extern const struct clk_ops ccu_div_ops; extern const struct clk_ops clk_pll_ops; extern const struct regmap_config th1520_clk_regmap_config; +extern const struct clk_ops ccu_gate_ops; #endif /* CLK_TH1520_H */ From patchwork Tue Dec 3 13:41:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Wilczynski X-Patchwork-Id: 847532 Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D3A8A1F4280 for ; Tue, 3 Dec 2024 13:42:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.118.77.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733233325; cv=none; b=EB3nbgKYJ39bEqnQ69JQRRlU1FL8A5xAjtfPvXRYCGPweHJyXlWRPk2D5ALKA/kYLDBrmxO19JUvmg1wNaqN6sfmfXGSlewnBZhgMHxqRU6hiMnMf5n/lmSSGMBxJZRUPZ/nseqrqA/cbgL3+m0rHDWEBHGbt8OveBNIFkurEvc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733233325; c=relaxed/simple; bh=/8XEfny0FAe2wUqpCRK3PGVTg4J5SEm5ROdZaTcOlAE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:MIME-Version: Content-Type:References; b=LJxLOcM1ue8qm6W5eEpNOXZRiDw9bXDkKenzhtNBsZ52dM/puMRmL8D05CRQ7uUMDvcuSqaqaiqyucI1hncGY/TNVmxTmFdITTWr8Dx9GBmKfrza7p93pZnwgx29vxa5ckA1wy/mApRVjIuDBN9uxwdO3MXpLQABWMvUXhs1nWY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com; spf=pass smtp.mailfrom=samsung.com; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b=heu+TRBy; arc=none smtp.client-ip=210.118.77.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=samsung.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="heu+TRBy" Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20241203134155euoutp0182af37b7a831e8e77f06fe6032335eed~NroRXOsVf2386523865euoutp01G for ; Tue, 3 Dec 2024 13:41:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20241203134155euoutp0182af37b7a831e8e77f06fe6032335eed~NroRXOsVf2386523865euoutp01G DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1733233315; bh=ftJtjrtV1f+CN8Y0edQsq5ZTa846Imc3sylesI9yWLA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=heu+TRBy27PLRLo1UUHBiBEg/f6Bh8AF4/6dDCBNXZuikkZRr13AaZPBLvf8dGwW8 zaeWWMgsIvYMlVdx24vNoPzdALPZyJcPCn3LOoVd4WZ6tIKgiO2q5pVv5JA6fN+hsZ vhdS4uvFIHucSrD/BO38wi33Bl+Zj1bJv+ZiO/V0= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20241203134154eucas1p2015ac2747f0d4c4b86a5fb5658eb2731~NroQ3CUnO2016720167eucas1p2-; Tue, 3 Dec 2024 13:41:54 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 44.CA.20821.2AA0F476; Tue, 3 Dec 2024 13:41:54 +0000 (GMT) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20241203134154eucas1p12517024f618800141cd4e7e20e0da72d~NroQdUdOa1267312673eucas1p1z; Tue, 3 Dec 2024 13:41:54 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20241203134154eusmtrp1f6533d8bc671769e5a3de5d80dacb10d~NroQcfCxW0887308873eusmtrp1J; Tue, 3 Dec 2024 13:41:54 +0000 (GMT) X-AuditID: cbfec7f2-b09c370000005155-68-674f0aa2d554 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 9A.F6.19654.1AA0F476; Tue, 3 Dec 2024 13:41:53 +0000 (GMT) Received: from AMDC4942.home (unknown [106.210.136.40]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20241203134152eusmtip2f94341df43485e788fcf49425b4d1759~NroPHR5Hm2944429444eusmtip2O; Tue, 3 Dec 2024 13:41:52 +0000 (GMT) From: Michal Wilczynski To: mturquette@baylibre.com, sboyd@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, drew@pdp7.com, guoren@kernel.org, wefu@redhat.com, jassisinghbrar@gmail.com, paul.walmsley@sifive.com, palmer@dabbelt.com, aou@eecs.berkeley.edu, frank.binns@imgtec.com, matt.coster@imgtec.com, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, simona@ffwll.ch, ulf.hansson@linaro.org, jszhang@kernel.org, m.szyprowski@samsung.com Cc: linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, dri-devel@lists.freedesktop.org, linux-pm@vger.kernel.org, Michal Wilczynski Subject: [RFC PATCH v1 04/14] clk: thead: Add clock driver for TH1520 Video Output subsystem Date: Tue, 3 Dec 2024 14:41:27 +0100 Message-Id: <20241203134137.2114847-5-m.wilczynski@samsung.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241203134137.2114847-1-m.wilczynski@samsung.com> Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA01SbUxTVxjOuff23ktj9VIYPdENFcFMFz7V5EyclsXpFZiImSwuC6wZd9WM D9OCH9sYIIzPYkAhulKEESOMrDSD0gABKsioUKyzYOk2qGxhyJcQiiiwRWe5bPPf8z7v857n fd4cGhc3kBvp00kpnCJJluBDCglDz7LFv1oYJQ8qXZKgO0PVGGr6S02hH9otGKrstgiQw6rH 0ODiHInq//yZQhPtmQSy1VZQKKtHR6JJtYNE8yqHAA20aki0UNQNkGEhm0Ta7hEK6RYrMfTd fBOBbjS3ApSTf1OA7ve9hyYHVDjKUW9AL9qaKfTc9iOBymeNFNLPlAiQSfshyjaWEtI32Dn7 NxQ7MzlJsLfznlBs+9Mqgm1Rj1CsqqUfsA11+SQ7bGsj2eu90ezDQhPGNt5IZ7O1PRg71/GA ZC/p6wBrzRqi2Ebzl8fcPxLui+cSTp/lFIH7PxGeGrNN4Wcyjp7vq7iHZ4DGsALgRkNmNxwb XSILgJAWM7UAOp13ML54AqB+0QH4YgHA8sw+qgDQqyMj1bE8XwOgyVy8JpoBsPniFHC9SzIh cLSmUuBqeDLTOLQv/rJqgjOPADSMaUiXyoOJhbPPslcnCMYP5hvNq7yIOQCzBjQCfsPN0Nh5 F3dhN0YKp8sKBLzGHfZ+O0a4MP5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9IxMLPUMjc1jrYxMlfTtbFJSczLL Uov07RL0Mp5ce8Vc0OBXcWrueeYGxs2OXYwcHBICJhJ3F8V1MXJyCAksZZQ4+MIQxJYQkJG4 1v2SBcIWlvhzrYuti5ELqOYVo8T048vBEmwCRhIPls9nBUmICHSySLzdvJYRxGEWeMsocX3m RrAqYYEYiYfndzOB2CwCqhKd+0+zgdi8AvYSzZfnsEKskJfYf/AsM4jNKeAg8XpqFyvESfYS O/4eZoWoF5Q4OfMJ2ExmoPrmrbOZJzAKzEKSmoUktYCRaRWjSGppcW56brGRXnFibnFpXrpe cn7uJkZgUtl27OeWHYwrX33UO8TIxMF4iFGCg1lJhHf5eu90Id6UxMqq1KL8+KLSnNTiQ4ym QHdPZJYSTc4HprW8knhDMwNTQxMzSwNTSzNjJXFetivn04QE0hNLUrNTUwtSi2D6mDg4pRqY YgQ0yhl/bN9U/2dn9Qb2Z5UuRRx72srz/AI5U5zlmOece+/yh0nn5An26C6LN/51c0+urjxT bpXPKfhM+ABX3WPeCMuqAu9Hx20sXSz0F18TPXxoXV/m/4afnYs9z61kV9qzbmG7+AXuyk1t lZn7L/xS27f2Qn7lVCPp17HMD0XXL61euux65YN2p4x9H9SeLWwJnfV4x/8NEarbFsU3ZfRO sJ5vWrJ96bzrfxaEFk1I/uFjsUrH07Vgbeeip7abr9o6ySWfy1IO2cCq4lQhs69abvMZTbUM 9epTRpXdDF/WxPj6NTH8//S0OUYoensMs2HopqLKGTV816L0zX4ErLV7zizwTfGOcLiZM78S S3FGoqEWc1FxIgD4HSclswMAAA== X-CMS-MailID: 20241203134154eucas1p12517024f618800141cd4e7e20e0da72d X-Msg-Generator: CA X-RootMTR: 20241203134154eucas1p12517024f618800141cd4e7e20e0da72d X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20241203134154eucas1p12517024f618800141cd4e7e20e0da72d References: <20241203134137.2114847-1-m.wilczynski@samsung.com> The Video Output (VO) module on the T-Head TH1520 SoC has its own set of clocks that need proper management. This commit introduces the clk-th1520-vo driver to support the VO subsystem clocks. Currently, only the clock gates are implemented, as they are the primary relevant clocks for the VO subsystem at this stage. Signed-off-by: Michal Wilczynski --- drivers/clk/thead/Kconfig | 11 ++ drivers/clk/thead/Makefile | 1 + drivers/clk/thead/clk-th1520-vo.c | 168 +++++++++++++++++++ include/dt-bindings/clock/thead,th1520-clk.h | 34 ++++ 4 files changed, 214 insertions(+) create mode 100644 drivers/clk/thead/clk-th1520-vo.c diff --git a/drivers/clk/thead/Kconfig b/drivers/clk/thead/Kconfig index 95e0d9eb965e..937927a1a4b8 100644 --- a/drivers/clk/thead/Kconfig +++ b/drivers/clk/thead/Kconfig @@ -11,3 +11,14 @@ config CLK_THEAD_TH1520_AP on the T-HEAD TH1520 SoC. This includes configuration of both CPU PLLs, both DPU PLLs as well as the GMAC, VIDEO, and TEE PLLs. + +config CLK_THEAD_TH1520_VO + bool "T-HEAD TH1520 VO clock support" + depends on ARCH_THEAD || COMPILE_TEST + depends on 64BIT + default ARCH_THEAD + select REGMAP_MMIO + help + Say yes here to support the VO sub system clock controller + on the T-HEAD TH1520 SoC. This includes clock gates for the + Video Output components like HDMI, MIPI, DPU and GPU. diff --git a/drivers/clk/thead/Makefile b/drivers/clk/thead/Makefile index d7cf88390b69..9afaee27b0b9 100644 --- a/drivers/clk/thead/Makefile +++ b/drivers/clk/thead/Makefile @@ -1,2 +1,3 @@ # SPDX-License-Identifier: GPL-2.0 obj-$(CONFIG_CLK_THEAD_TH1520_AP) += clk-th1520.o clk-th1520-ap.o +obj-$(CONFIG_CLK_THEAD_TH1520_VO) += clk-th1520.o clk-th1520-vo.o diff --git a/drivers/clk/thead/clk-th1520-vo.c b/drivers/clk/thead/clk-th1520-vo.c new file mode 100644 index 000000000000..3c6d246ab53a --- /dev/null +++ b/drivers/clk/thead/clk-th1520-vo.c @@ -0,0 +1,168 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (c) 2024 Samsung Electronics Co., Ltd. + * Author: Michal Wilczynski + */ + +#include +#include "clk-th1520.h" + +#define NR_CLKS (CLK_HDMI_PIXCLK + 1) + +static const struct clk_parent_data video_pll_pd[] = { + /* TODO: provide a proper parent here */ + NULL, +}; + +static CCU_GATE_REGMAP(CLK_AXI4_VO_ACLK, axi4_vo_aclk, "axi4-vo-aclk", + video_pll_pd, 0x50, BIT(0), 0); +static CCU_GATE_REGMAP(CLK_GPU_CORE, gpu_core_clk, "gpu-core-clk", video_pll_pd, + 0x50, BIT(3), 0); +static CCU_GATE_REGMAP(CLK_GPU_CFG_ACLK, gpu_cfg_aclk, "gpu-cfg-aclk", + video_pll_pd, 0x50, BIT(4), 0); +static CCU_GATE_REGMAP(CLK_DPU_PIXELCLK0, dpu0_pixelclk, "dpu0-pixelclk", + video_pll_pd, 0x50, BIT(5), 0); +static CCU_GATE_REGMAP(CLK_DPU_PIXELCLK1, dpu1_pixelclk, "dpu1-pixelclk", + video_pll_pd, 0x50, BIT(6), 0); +static CCU_GATE_REGMAP(CLK_DPU_HCLK, dpu_hclk, "dpu-hclk", video_pll_pd, 0x50, + BIT(7), 0); +static CCU_GATE_REGMAP(CLK_DPU_ACLK, dpu_aclk, "dpu-aclk", video_pll_pd, 0x50, + BIT(8), 0); +static CCU_GATE_REGMAP(CLK_DPU_CCLK, dpu_cclk, "dpu-cclk", video_pll_pd, 0x50, + BIT(9), 0); +static CCU_GATE_REGMAP(CLK_HDMI_SFR, hdmi_sfr_clk, "hdmi-sfr-clk", video_pll_pd, + 0x50, BIT(10), 0); +static CCU_GATE_REGMAP(CLK_HDMI_PCLK, hdmi_pclk, "hdmi-pclk", video_pll_pd, + 0x50, BIT(11), 0); +static CCU_GATE_REGMAP(CLK_HDMI_CEC, hdmi_cec_clk, "hdmi-cec-clk", video_pll_pd, + 0x50, BIT(12), 0); +static CCU_GATE_REGMAP(CLK_MIPI_DSI0_PCLK, mipi_dsi0_pclk, "mipi-dsi0-pclk", + video_pll_pd, 0x50, BIT(13), 0); +static CCU_GATE_REGMAP(CLK_MIPI_DSI1_PCLK, mipi_dsi1_pclk, "mipi-dsi1-pclk", + video_pll_pd, 0x50, BIT(14), 0); +static CCU_GATE_REGMAP(CLK_MIPI_DSI0_CFG, mipi_dsi0_cfg_clk, + "mipi-dsi0-cfg-clk", video_pll_pd, 0x50, BIT(15), 0); +static CCU_GATE_REGMAP(CLK_MIPI_DSI1_CFG, mipi_dsi1_cfg_clk, + "mipi-dsi1-cfg-clk", video_pll_pd, 0x50, BIT(16), 0); +static CCU_GATE_REGMAP(CLK_MIPI_DSI0_REFCLK, mipi_dsi0_refclk, + "mipi-dsi0-refclk", video_pll_pd, 0x50, BIT(17), 0); +static CCU_GATE_REGMAP(CLK_MIPI_DSI1_REFCLK, mipi_dsi1_refclk, + "mipi-dsi1-refclk", video_pll_pd, 0x50, BIT(18), 0); +static CCU_GATE_REGMAP(CLK_HDMI_I2S, hdmi_i2c_clk, "hdmi-i2c-clk", video_pll_pd, + 0x50, BIT(19), 0); +static CCU_GATE_REGMAP(CLK_X2H_DPU1_ACLK, x2h_dpu1_aclk, "x2h-dpu1-aclk", + video_pll_pd, 0x50, BIT(20), 0); +static CCU_GATE_REGMAP(CLK_X2H_DPU_ACLK, x2h_dpu_aclk, "x2h-dpu-aclk", + video_pll_pd, 0x50, BIT(21), 0); +static CCU_GATE_REGMAP(CLK_AXI4_VO_PCLK, axi4_vo_pclk, "axi4-vo-pclk", + video_pll_pd, 0x50, BIT(22), 0); +static CCU_GATE_REGMAP(CLK_IOPMP_VOSYS_DPU_PCLK, iopmp_vosys_dpu_pclk, + "iopmp-vosys-dpu-pclk", video_pll_pd, 0x50, BIT(23), 0); +static CCU_GATE_REGMAP(CLK_IOPMP_VOSYS_DPU1_PCLK, iopmp_vosys_dpu1_pclk, + "iopmp-vosys-dpu1-pclk", video_pll_pd, 0x50, BIT(24), 0); +static CCU_GATE_REGMAP(CLK_IOPMP_VOSYS_GPU_PCLK, iopmp_vosys_gpu_pclk, + "iopmp-vosys-gpu-pclk", video_pll_pd, 0x50, BIT(25), 0); +static CCU_GATE_REGMAP(CLK_IOPMP_DPU1_ACLK, iopmp_dpu1_aclk, "iopmp-dpu1-aclk", + video_pll_pd, 0x50, BIT(27), 0); +static CCU_GATE_REGMAP(CLK_IOPMP_DPU_ACLK, iopmp_dpu_aclk, "iopmp-dpu-aclk", + video_pll_pd, 0x50, BIT(28), 0); +static CCU_GATE_REGMAP(CLK_IOPMP_GPU_ACLK, iopmp_gpu_aclk, "iopmp-gpu-aclk", + video_pll_pd, 0x50, BIT(29), 0); +static CCU_GATE_REGMAP(CLK_MIPIDSI0_PIXCLK, mipi_dsi0_pixclk, + "mipi-dsi0-pixclk", video_pll_pd, 0x50, BIT(30), 0); +static CCU_GATE_REGMAP(CLK_MIPIDSI1_PIXCLK, mipi_dsi1_pixclk, + "mipi-dsi1-pixclk", video_pll_pd, 0x50, BIT(31), 0); +static CCU_GATE_REGMAP(CLK_HDMI_PIXCLK, hdmi_pixclk, "hdmi-pixclk", + video_pll_pd, 0x54, BIT(0), 0); + +static struct ccu_common *th1520_vo_gate_clks[] = { + &axi4_vo_aclk.common, + &gpu_core_clk.common, + &gpu_cfg_aclk.common, + &dpu0_pixelclk.common, + &dpu1_pixelclk.common, + &dpu_hclk.common, + &dpu_aclk.common, + &dpu_cclk.common, + &hdmi_sfr_clk.common, + &hdmi_pclk.common, + &hdmi_cec_clk.common, + &mipi_dsi0_pclk.common, + &mipi_dsi1_pclk.common, + &mipi_dsi0_cfg_clk.common, + &mipi_dsi1_cfg_clk.common, + &mipi_dsi0_refclk.common, + &mipi_dsi1_refclk.common, + &hdmi_i2c_clk.common, + &x2h_dpu1_aclk.common, + &x2h_dpu_aclk.common, + &axi4_vo_pclk.common, + &iopmp_vosys_dpu_pclk.common, + &iopmp_vosys_dpu1_pclk.common, + &iopmp_vosys_gpu_pclk.common, + &iopmp_dpu1_aclk.common, + &iopmp_dpu_aclk.common, + &iopmp_gpu_aclk.common, + &mipi_dsi0_pixclk.common, + &mipi_dsi1_pixclk.common, + &hdmi_pixclk.common +}; + +static int th1520_clk_vo_probe(struct platform_device *pdev) +{ + struct device *dev = &pdev->dev; + struct device_node *np = dev->of_node; + struct clk_hw_onecell_data *priv; + struct regmap *map; + struct clk_hw *hw; + int ret, i; + + priv = devm_kzalloc(dev, struct_size(priv, hws, NR_CLKS), GFP_KERNEL); + if (!priv) + return -ENOMEM; + + priv->num = NR_CLKS; + + map = syscon_regmap_lookup_by_phandle(np, "thead,vosys-regmap"); + if (IS_ERR(map)) + return PTR_ERR(map); + + for (i = 0; i < ARRAY_SIZE(th1520_vo_gate_clks); i++) { + struct ccu_gate *cg = hw_to_ccu_gate(&th1520_vo_gate_clks[i]->hw); + + th1520_vo_gate_clks[i]->map = map; + + ret = devm_clk_hw_register(dev, &th1520_vo_gate_clks[i]->hw); + if (ret) + return ret; + + priv->hws[cg->common.clkid] = hw; + } + + ret = devm_of_clk_add_hw_provider(dev, of_clk_hw_onecell_get, priv); + if (ret) + return ret; + + return 0; +} + +static const struct of_device_id th1520_clk_vo_match[] = { + { + .compatible = "thead,th1520-clk-vo", + }, + { /* sentinel */ }, +}; +MODULE_DEVICE_TABLE(of, th1520_clk_vo_match); + +static struct platform_driver th1520_clk_vo_driver = { + .probe = th1520_clk_vo_probe, + .driver = { + .name = "th1520-clk-vo", + .of_match_table = th1520_clk_vo_match, + }, +}; +module_platform_driver(th1520_clk_vo_driver); + +MODULE_DESCRIPTION("T-HEAD TH1520 VO Clock driver"); +MODULE_AUTHOR("Michal Wilczynski "); +MODULE_LICENSE("GPL"); diff --git a/include/dt-bindings/clock/thead,th1520-clk.h b/include/dt-bindings/clock/thead,th1520-clk.h index a199784b3512..86a7cf2c9acf 100644 --- a/include/dt-bindings/clock/thead,th1520-clk.h +++ b/include/dt-bindings/clock/thead,th1520-clk.h @@ -7,6 +7,7 @@ #ifndef _DT_BINDINGS_CLK_TH1520_H_ #define _DT_BINDINGS_CLK_TH1520_H_ +/* AP clocks */ #define CLK_CPU_PLL0 0 #define CLK_CPU_PLL1 1 #define CLK_GMAC_PLL 2 @@ -93,4 +94,37 @@ #define CLK_SRAM3 83 #define CLK_PLL_GMAC_100M 84 #define CLK_UART_SCLK 85 + +/* VO clocks */ +#define CLK_AXI4_VO_ACLK 0 +#define CLK_GPU_CORE 1 +#define CLK_GPU_CFG_ACLK 2 +#define CLK_DPU_PIXELCLK0 3 +#define CLK_DPU_PIXELCLK1 4 +#define CLK_DPU_HCLK 5 +#define CLK_DPU_ACLK 6 +#define CLK_DPU_CCLK 7 +#define CLK_HDMI_SFR 8 +#define CLK_HDMI_PCLK 9 +#define CLK_HDMI_CEC 10 +#define CLK_MIPI_DSI0_PCLK 11 +#define CLK_MIPI_DSI1_PCLK 12 +#define CLK_MIPI_DSI0_CFG 13 +#define CLK_MIPI_DSI1_CFG 14 +#define CLK_MIPI_DSI0_REFCLK 15 +#define CLK_MIPI_DSI1_REFCLK 16 +#define CLK_HDMI_I2S 17 +#define CLK_X2H_DPU1_ACLK 18 +#define CLK_X2H_DPU_ACLK 19 +#define CLK_AXI4_VO_PCLK 20 +#define CLK_IOPMP_VOSYS_DPU_PCLK 21 +#define CLK_IOPMP_VOSYS_DPU1_PCLK 22 +#define CLK_IOPMP_VOSYS_GPU_PCLK 23 +#define CLK_IOPMP_DPU1_ACLK 24 +#define CLK_IOPMP_DPU_ACLK 25 +#define CLK_IOPMP_GPU_ACLK 26 +#define CLK_MIPIDSI0_PIXCLK 27 +#define CLK_MIPIDSI1_PIXCLK 28 +#define CLK_HDMI_PIXCLK 29 + #endif From patchwork Tue Dec 3 13:41:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Wilczynski X-Patchwork-Id: 847183 Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8FDDF1F4271 for ; Tue, 3 Dec 2024 13:42:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.118.77.12 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733233327; cv=none; b=CgMN+bRLFYyG7YC+A8dvtdBmXClvQtza1grDY+8bclOvFdaJ7ZF6AP64ctZXpTw/CyYxqHKoSQj/EbACStPcn/BUjQJssUpCytZJjLF82Cu2DlZbtL4Mef9g4PqXawBywsLcC0kodGIujrP7S4ILTcPuJHw/WQvD17AlKoRHRO0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733233327; c=relaxed/simple; bh=Nqyna1A9VacqtygRVnIGLEVKoTV2UL7pR34DW34RArY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:MIME-Version: Content-Type:References; b=ZmpDrray56WJJOt+fwpACAV0E2Jgu70vrxT6qtn08KtfasdlW1uwDb2zTPXNxSfOb/xRNoodxadQT9ZMt72MZKvSPQhsrbD9m+TQqlTk1kKpRy3k/kgyaw5+ctoM/V7iGP39uMSBadVOv4PsQoQLSzFKi1UsvnjC84Y43prKaDc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com; spf=pass smtp.mailfrom=samsung.com; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b=dPo+T0rd; arc=none smtp.client-ip=210.118.77.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=samsung.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="dPo+T0rd" Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20241203134156euoutp02729590d55246986b616a2a2ff38c7583~NroSoGzBx3035730357euoutp02e for ; Tue, 3 Dec 2024 13:41:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20241203134156euoutp02729590d55246986b616a2a2ff38c7583~NroSoGzBx3035730357euoutp02e DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1733233316; bh=oC+R2AH5wsqjet5ieb6+rxFp1u3nZ9Z07QmkpORzdC0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dPo+T0rdkn45cMrQ0jm8Wk68x/51nKYFsWCfxjcXwXzxO8hNluqZ+bNekjTxg25M2 b2A4WmUf/rNntP1/Pfdt5buqOCP3Y/0sCrjq3OJIxrnKhNtpj/h+qzAxKS21P7QA1N jT0OfDLgP79B2U62XG8Ruds92UaGgh9b6y80zIkU= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20241203134155eucas1p294a7b3f321d9cfa02c1aad2d8fa8d87e~NroSMRyE71760217602eucas1p2r; Tue, 3 Dec 2024 13:41:55 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 56.CA.20821.3AA0F476; Tue, 3 Dec 2024 13:41:55 +0000 (GMT) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20241203134155eucas1p1e90c71c4f8eb5da41d2cc8a500f54dc7~NroRwtF5v1266212662eucas1p1w; Tue, 3 Dec 2024 13:41:55 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20241203134155eusmtrp1407a8f487afcd4c15fd63225fc616274~NroRv7CKL0888908889eusmtrp1C; Tue, 3 Dec 2024 13:41:55 +0000 (GMT) X-AuditID: cbfec7f2-b11c470000005155-6b-674f0aa3a1bb Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 8C.F6.19654.3AA0F476; Tue, 3 Dec 2024 13:41:55 +0000 (GMT) Received: from AMDC4942.home (unknown [106.210.136.40]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20241203134153eusmtip2eceb173357aae7426c9f6aa66d4a47de~NroQX2oFo3160631606eusmtip2D; Tue, 3 Dec 2024 13:41:53 +0000 (GMT) From: Michal Wilczynski To: mturquette@baylibre.com, sboyd@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, drew@pdp7.com, guoren@kernel.org, wefu@redhat.com, jassisinghbrar@gmail.com, paul.walmsley@sifive.com, palmer@dabbelt.com, aou@eecs.berkeley.edu, frank.binns@imgtec.com, matt.coster@imgtec.com, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, simona@ffwll.ch, ulf.hansson@linaro.org, jszhang@kernel.org, m.szyprowski@samsung.com Cc: linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, dri-devel@lists.freedesktop.org, linux-pm@vger.kernel.org, Michal Wilczynski Subject: [RFC PATCH v1 05/14] dt-bindings: clock: thead,th1520: Add support for Video Output subsystem Date: Tue, 3 Dec 2024 14:41:28 +0100 Message-Id: <20241203134137.2114847-6-m.wilczynski@samsung.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241203134137.2114847-1-m.wilczynski@samsung.com> Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA01Sa0xTZxjed87pOaVZ8VBc+qXg2FgwMjIuuixfcDKmgx2iCc4sIdsypIyz YsbFtCAgJkOLTKDdxi3MUi4OFNaAXbFlXMpQ6KhaYBsqoAHGiHWrIKRctilaRjl189/zvs/z vO/7fPn4uMhASvhHMrJYeYY0LZAUEB2DD0deaxTEy8JPd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ZW9XHf5nHczvc/UKoqf232KU99cp6Vp/q4SQfeqzz/OehVLaj6cIMIbYXOa41+q m8/S26ubcn5Eqs9Ie3Uh8ATfk5kaa3Jk91qJrZq8O8GSP8A609MzJnfXEitdoaaPz60u622y Dln+1XWB88OtG2/52F48O/X0qWlmleEc3Q0Pl//0iF+4SUTp0alP6ySf7j/fJD7lbrESS3FG oqEWc1FxIgDl0upfsQMAAA== X-CMS-MailID: 20241203134155eucas1p1e90c71c4f8eb5da41d2cc8a500f54dc7 X-Msg-Generator: CA X-RootMTR: 20241203134155eucas1p1e90c71c4f8eb5da41d2cc8a500f54dc7 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20241203134155eucas1p1e90c71c4f8eb5da41d2cc8a500f54dc7 References: <20241203134137.2114847-1-m.wilczynski@samsung.com> The device tree bindings for the T-Head TH1520 SoC clocks currently support only the Application Processor (AP) subsystem. This commit extends the bindings to include the Video Output (VO) subsystem clocks. Update the YAML schema to define the VO subsystem clocks, allowing the clock driver to configure and manage these clocks appropriately. This addition is necessary to enable the proper operation of the video output features on the TH1520 SoC. Signed-off-by: Michal Wilczynski --- .../bindings/clock/thead,th1520-clk-ap.yaml | 31 +++++++++++++++---- 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/Documentation/devicetree/bindings/clock/thead,th1520-clk-ap.yaml b/Documentation/devicetree/bindings/clock/thead,th1520-clk-ap.yaml index 4a0806af2bf9..5a8f1041f766 100644 --- a/Documentation/devicetree/bindings/clock/thead,th1520-clk-ap.yaml +++ b/Documentation/devicetree/bindings/clock/thead,th1520-clk-ap.yaml @@ -4,11 +4,13 @@ $id: http://devicetree.org/schemas/clock/thead,th1520-clk-ap.yaml# $schema: http://devicetree.org/meta-schemas/core.yaml# -title: T-HEAD TH1520 AP sub-system clock controller +title: T-HEAD TH1520 sub-systems clock controller description: | - The T-HEAD TH1520 AP sub-system clock controller configures the - CPU, DPU, GMAC and TEE PLLs. + The T-HEAD TH1520 sub-systems clock controller configures the + CPU, DPU, GMAC and TEE PLLs for the AP subsystem. For the VO + subsystem clock gates can be configured for the HDMI, MIPI and + the GPU. SoC reference manual https://openbeagle.org/beaglev-ahead/beaglev-ahead/-/blob/main/docs/TH1520%20System%20User%20Manual.pdf @@ -20,7 +22,9 @@ maintainers: properties: compatible: - const: thead,th1520-clk-ap + enum: + - thead,th1520-clk-ap + - thead,th1520-clk-vo reg: maxItems: 1 @@ -29,6 +33,17 @@ properties: items: - description: main oscillator (24MHz) + thead,vosys-regmap: + $ref: /schemas/types.yaml#/definitions/phandle + description: | + Phandle to a syscon node representing the shared register + space of the VO (Video Output) subsystem. This register space + includes both clock control registers and other control + registers used for operations like resetting the GPU. Since + these registers reside in the same address space, access to + them is coordinated through a shared syscon regmap provided by + the specified syscon node. + "#clock-cells": const: 1 description: @@ -36,8 +51,6 @@ properties: required: - compatible - - reg - - clocks - "#clock-cells" additionalProperties: false @@ -51,3 +64,9 @@ examples: clocks = <&osc>; #clock-cells = <1>; }; + + clock-controller-vo { + compatible = "thead,th1520-clk-vo"; + thead,vosys-regmap = <&vosys_regmap>; + #clock-cells = <1>; + }; From patchwork Tue Dec 3 13:41:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Wilczynski X-Patchwork-Id: 847531 Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E155D1F4736 for ; Tue, 3 Dec 2024 13:42:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.118.77.12 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733233328; cv=none; b=lMiqmTZjGt2EPsqk57fdX3LQqTIFZ+oUO1MaTQupRE8Ywll9FlSd/Dn2cpZPRMKBdtQxEEc16vLWhpV8HlSsJe3VKpMgWwbv8J0mkoqY+yP0n0tuzsN3Q+J4W/wfL1JDmCnMVdK7JJhxhDYv2cn/CxoJiKMOz6PJv9zNki8EazE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733233328; c=relaxed/simple; bh=3iaMTps/zUYAo1YPwfiTddvUGRMQeQVJMHNtJDXnPtU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:MIME-Version: Content-Type:References; b=d4JoKqrAMyfxKl1q/0y9cDIskb9kQOkiAtR/DTVXkTk+GXteEPFjdJLzNBPtX1552yBOkEgyuB76ABH1PSI0czlF+c68oq4KeFtkz3/EE4qe/rTmYAOexiTgsgQbiWMGs+bAon+ytU/MIMrVRD8ymLzU/vCxMpjiGsADR7IT/0A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com; spf=pass smtp.mailfrom=samsung.com; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b=aznlbACL; arc=none smtp.client-ip=210.118.77.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=samsung.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="aznlbACL" Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20241203134157euoutp02bd819f838d4b1c58629415ea7a675b0a~NroT9FzoU3035030350euoutp02S for ; Tue, 3 Dec 2024 13:41:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20241203134157euoutp02bd819f838d4b1c58629415ea7a675b0a~NroT9FzoU3035030350euoutp02S DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1733233317; bh=5rBePMS44xnD+OwXpDSSPcmNCrh1lKWMdJ1IYE/6SpA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aznlbACLHvSNxstEGzxKWl2jAngBf1qfe63+gZ89x5jroyRBtIF7tpXQdsJ2vHVVH F4nwZ6NHcr5fNqnPbMGkCJrVbujeizc/V65Qkt2BZAPZEdelVkFa1TS1Z1pV1FlngL g1xUCclib6E0AjJ1RpdJ3I4YIspJR0PdsfWumnAs= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20241203134157eucas1p2b259dbaaa19422fc4d713764e4c39d94~NroTVhodu0738707387eucas1p2s; Tue, 3 Dec 2024 13:41:57 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 7D.51.20397.5AA0F476; Tue, 3 Dec 2024 13:41:57 +0000 (GMT) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20241203134156eucas1p2326d84fcef2ee0914586122520b18dcc~NroS8-_QU1693616936eucas1p2b; Tue, 3 Dec 2024 13:41:56 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20241203134156eusmtrp2bf0d371dc92520a7b853fc19affbb0ad~NroS7316B3035030350eusmtrp2z; Tue, 3 Dec 2024 13:41:56 +0000 (GMT) X-AuditID: cbfec7f5-e59c770000004fad-3a-674f0aa55bf7 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 6F.C8.19920.4AA0F476; Tue, 3 Dec 2024 13:41:56 +0000 (GMT) Received: from AMDC4942.home (unknown [106.210.136.40]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20241203134155eusmtip23d5cc2bd36f9dc0fb0e7adc5825ec3a0~NroRnuaU93133331333eusmtip2d; Tue, 3 Dec 2024 13:41:55 +0000 (GMT) From: Michal Wilczynski To: mturquette@baylibre.com, sboyd@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, drew@pdp7.com, guoren@kernel.org, wefu@redhat.com, jassisinghbrar@gmail.com, paul.walmsley@sifive.com, palmer@dabbelt.com, aou@eecs.berkeley.edu, frank.binns@imgtec.com, matt.coster@imgtec.com, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, simona@ffwll.ch, ulf.hansson@linaro.org, jszhang@kernel.org, m.szyprowski@samsung.com Cc: linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, dri-devel@lists.freedesktop.org, linux-pm@vger.kernel.org, Michal Wilczynski Subject: [RFC PATCH v1 06/14] dt-bindings: clock: thead,th1520: Rename YAML schema file Date: Tue, 3 Dec 2024 14:41:29 +0100 Message-Id: <20241203134137.2114847-7-m.wilczynski@samsung.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241203134137.2114847-1-m.wilczynski@samsung.com> Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA02SfUxbZRTGfe+9vfdSU7iUTd5At4U60GnskBXzOsnAZMabzAQ1i5MNlSpX NuRjaYHNwQRXRD4K2ZYxt1KgLGArGdaND2kD8illsBaBjbXKgBm2UehE6Fh0LiDlMt1/v3PO 8z7POclL4+IfyCD6UFoGp0xTpEhJIdHS97f9pTphbFJ4l16A+m9cwFDzP1oKXWy3Y6i61y5A EyNNGLq2NE+i72//QqGZ9i8JNGaspJC6z0Qil3aCRAuaCQEatehI5CntBajFk0+iht6bFDIt VWOoZqGZQLWtFoAKir4VoOGBN5BrVIOjAq0fWmlrpdDy2CUCVfzRQaEm9ykBsjbsQ/kdZ4iY Tey84yuKdbtcBNtTeJ9i2x/oCdasvUmxGvNVwF6uLyLZ8b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oU/juKfot8Z6LEUpyR aKjFXFScCADRXE+gswMAAA== X-CMS-MailID: 20241203134156eucas1p2326d84fcef2ee0914586122520b18dcc X-Msg-Generator: CA X-RootMTR: 20241203134156eucas1p2326d84fcef2ee0914586122520b18dcc X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20241203134156eucas1p2326d84fcef2ee0914586122520b18dcc References: <20241203134137.2114847-1-m.wilczynski@samsung.com> As support for clocks from new subsystems is being added to the T-Head TH1520 SoC, the Device Tree binding YAML schema file name should reflect this broader scope. The existing schema file 'thead,th1520-clk-ap.yaml' includes the '-ap' suffix, indicating it's specific to the Application Processor (AP) subsystem. Rename the YAML schema file to 'thead,th1520-clk.yaml' to generalize it for all subsystems. Update all references to this schema file accordingly. Signed-off-by: Michal Wilczynski --- .../clock/{thead,th1520-clk-ap.yaml => thead,th1520-clk.yaml} | 2 +- MAINTAINERS | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename Documentation/devicetree/bindings/clock/{thead,th1520-clk-ap.yaml => thead,th1520-clk.yaml} (96%) diff --git a/Documentation/devicetree/bindings/clock/thead,th1520-clk-ap.yaml b/Documentation/devicetree/bindings/clock/thead,th1520-clk.yaml similarity index 96% rename from Documentation/devicetree/bindings/clock/thead,th1520-clk-ap.yaml rename to Documentation/devicetree/bindings/clock/thead,th1520-clk.yaml index 5a8f1041f766..416c8882942e 100644 --- a/Documentation/devicetree/bindings/clock/thead,th1520-clk-ap.yaml +++ b/Documentation/devicetree/bindings/clock/thead,th1520-clk.yaml @@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause %YAML 1.2 --- -$id: http://devicetree.org/schemas/clock/thead,th1520-clk-ap.yaml# +$id: http://devicetree.org/schemas/clock/thead,th1520-clk.yaml# $schema: http://devicetree.org/meta-schemas/core.yaml# title: T-HEAD TH1520 sub-systems clock controller diff --git a/MAINTAINERS b/MAINTAINERS index bd4bbf07d588..2f8f529e6a31 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -20183,7 +20183,7 @@ M: Fu Wei L: linux-riscv@lists.infradead.org S: Maintained T: git https://github.com/pdp7/linux.git -F: Documentation/devicetree/bindings/clock/thead,th1520-clk-ap.yaml +F: Documentation/devicetree/bindings/clock/thead,th1520-clk.yaml F: Documentation/devicetree/bindings/mailbox/thead,th1520-mbox.yaml F: Documentation/devicetree/bindings/net/thead,th1520-gmac.yaml F: Documentation/devicetree/bindings/pinctrl/thead,th1520-pinctrl.yaml From patchwork Tue Dec 3 13:41:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Wilczynski X-Patchwork-Id: 847530 Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 25FAE1F6662 for ; Tue, 3 Dec 2024 13:42:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.118.77.12 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733233329; cv=none; b=egPqDzP+cT7dGefatjB84un9Hte3iUjkaSBmYMecMvvhFkMlAaMGilTWoh8s2JUoMlTmxq4HoIa4E4hSmk4ysvwTUTa9+b0JWQxn10DwDO6JTlBFFQR42CWi1q5qr7NaHSR4qlscGq9iMyRBgwjD9/B/2W61HMeaw1EssVdKuME= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733233329; c=relaxed/simple; bh=5FTMoHzrWaSVFbnPl/ZGYfd0/qy04CJiUOOnbOLkLA4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:MIME-Version: Content-Type:References; b=qu9GBnGcN87SGgua8Nbe/SkmB/jsDm2eD3HPic9qcODCV1CXS++Rkp5cZKsrApTRDDfzuf6Y+jM9Io4rKtmq5Tw7I8hBMdImxriFo4Onr2OC7lUMwgDMup6zYpkGV5/4LdVbggkAjwcVnRHXwlR6+wSrHNgxXqljD/UyO9tYjGE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com; spf=pass smtp.mailfrom=samsung.com; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b=Nb65zFn2; arc=none smtp.client-ip=210.118.77.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=samsung.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="Nb65zFn2" Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20241203134159euoutp0207252c3cd716693fdb97a3df83d0ebdf~NroVLU9Tv0142101421euoutp02M for ; Tue, 3 Dec 2024 13:41:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20241203134159euoutp0207252c3cd716693fdb97a3df83d0ebdf~NroVLU9Tv0142101421euoutp02M DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1733233319; bh=7vWqCZHhnB/kLRjyQw7yTqQkPU5mCbGCFqBzjoU0MzM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Nb65zFn2X11EO4+ngZDIwKFne/C5HincZiOH/T7iZD1gwKWqU5jpzaz9WtTyhL1x9 5ky7rCn+4/PUmaPvfD8BFlx4uY69vQKEDkUdUl9eJ3lIdnaMjerBkMSN+76xTg4f7m uHV8ZtLsGHJcyCwKTU/ns3RUGRC+CSsLB94v8PLs= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20241203134158eucas1p173695b11180e65af1b0adbb42951dab5~NroUtbWfG2135221352eucas1p1-; Tue, 3 Dec 2024 13:41:58 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 66.8F.20409.6AA0F476; Tue, 3 Dec 2024 13:41:58 +0000 (GMT) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20241203134158eucas1p1fae346180c0166570ea7e7723076225c~NroUMMsZz2466124661eucas1p1u; Tue, 3 Dec 2024 13:41:58 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20241203134158eusmtrp12c6e026a48b1b32a921993c6bf37ce78~NroULWYK40888908889eusmtrp1G; Tue, 3 Dec 2024 13:41:58 +0000 (GMT) X-AuditID: cbfec7f4-c39fa70000004fb9-8b-674f0aa6ed9a Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 4F.F6.19654.5AA0F476; Tue, 3 Dec 2024 13:41:57 +0000 (GMT) Received: from AMDC4942.home (unknown [106.210.136.40]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20241203134156eusmtip28456b9c6ad65c0da49bb5bf6132bdc18~NroS3YUQb3010130101eusmtip2Y; Tue, 3 Dec 2024 13:41:56 +0000 (GMT) From: Michal Wilczynski To: mturquette@baylibre.com, sboyd@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, drew@pdp7.com, guoren@kernel.org, wefu@redhat.com, jassisinghbrar@gmail.com, paul.walmsley@sifive.com, palmer@dabbelt.com, aou@eecs.berkeley.edu, frank.binns@imgtec.com, matt.coster@imgtec.com, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, simona@ffwll.ch, ulf.hansson@linaro.org, jszhang@kernel.org, m.szyprowski@samsung.com Cc: linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, dri-devel@lists.freedesktop.org, linux-pm@vger.kernel.org, Michal Wilczynski Subject: [RFC PATCH v1 07/14] soc: thead: power-domain: Add skeleton power-domain driver for TH1520 Date: Tue, 3 Dec 2024 14:41:30 +0100 Message-Id: <20241203134137.2114847-8-m.wilczynski@samsung.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241203134137.2114847-1-m.wilczynski@samsung.com> Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA01SfVBUdRSd33tv33u7uPZYGfYXYdYSNFECYU0/0UlzMt72YVIzfVlDWzwX R2BtV0QTYw1aAVekwBgWi8URlhgIgWWDBeRzWA3cCBI2gwUVQoRYiI9GCozlYfnfueeec8+9 M5fGJRdIH3pf3EFOHaeIkZEiwtJ+56eNRaLXlSEu5yPoUt85DFX/baBQaYMdQ/ltdgFydpsx 9Muci0Tfj3RR6FbDcQL1Fn9DoeT2chKNGZwkmtY7BajHepZEM6faALLMpJCorG2AQuVz+Rgq mK4m0PkaK0C6tCIB+vnHnWisR48jneEBdLe+hkJLvRUEyptspJB54ksBspW9jVIas4nt61mX 4wuKnRgbI9jW1FmKbZg3EmytYYBi9bWdgK0sSSPZ/t56kv32cgQ7eNKGsVXnk9iUsnaMdV28 SrIZ5hLAdif3UWxVx9Hdnu+JtkZxMfsOcerg5z8URd8xLhEHTu8+nFEo1ILqHelASEPmGVg4 awbpQERLmGIAU+Ydq8UsgFdzckm+mAHw+s0e8p7FWXFOwDdMAFpLf1u1TACorx8i3CqSCYVD pvwVlRczjkPH3K8rs3BmFEDL8NmVWesYDpZ3li07aJpg/OGo9kE3LWa2wZtfTwM+bgNsbL6C u7GQ2Q7Hz6QLeI0nvJw7vBKGL2uSq/Nw93zIfCeCC66RVfOLcLbdifN4HbxtM1M89oUdWXqC xyo4VP3nqiYR1uptq3gL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jVqcuRk4OCQETiXsbF7F2MXJxCAksZZT482cmM0RCRuJa 90sWCFtY4s+1LjaIoleMEg29S9lBEmwCRhIPls8H6xYR6GSReLt5LSOIwyzwllHi+syNYO3C AskSh7e/B7I5OFgEVCWeN0iChHkF7CUeT/vICLFBXmL/wbNgmzkFHCReT+1iBbGFgGp2/D3M ClEvKHFy5hOwkcxA9c1bZzNPYBSYhSQ1C0lqASPTKkaR1NLi3PTcYiO94sTc4tK8dL3k/NxN jMCksu3Yzy07GFe++qh3iJGJg/EQowQHs5II7/L13ulCvCmJlVWpRfnxRaU5qcWHGE2Bzp7I LCWanA9Ma3kl8YZmBqaGJmaWBqaWZsZK4rxsV86nCQmkJ5akZqemFqQWwfQxcXBKNTCpGcSs cd374kTRp6KWxQeUZn15oLndv3ny5L5LbmK6PLIbi6V/S2yct1BxYd2+vyFLrtR+aNzolfz7 wUSBBy/kcgWyzmRyJz+1yqnRvBAmabntY/z99oUHipqbs9/uL18++77GA4WWhldZuz5+PZ3A Ja8QwbF5kespxcjivPOes5V/ZNvwicb3z5kk/t0ouCxkYtDODceTAruN35cZunEdl/zGtSwg bOaBNWyLd7OsKOayPPxjJWfzZsZnk5eezhI3L95eu2fHUe5Pq8vYdRMvrOPz/N4QEpBS2fF7 e/h2r0MPN/5ME6l/WM4dFrRJoLol8YL2ir8tezWeOwdLTtU0yBLsP5Zb0frizHaZA7eVWIoz Eg21mIuKEwEgVJCeswMAAA== X-CMS-MailID: 20241203134158eucas1p1fae346180c0166570ea7e7723076225c X-Msg-Generator: CA X-RootMTR: 20241203134158eucas1p1fae346180c0166570ea7e7723076225c X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20241203134158eucas1p1fae346180c0166570ea7e7723076225c References: <20241203134137.2114847-1-m.wilczynski@samsung.com> The T-Head TH1520 SoC contains multiple power islands that can be programmatically turned on and off using the AON (Always-On) protocol and a hardware mailbox [1]. The relevant mailbox driver has already been merged into the mainline kernel in commit 5d4d263e1c6b ("mailbox: Introduce support for T-head TH1520 Mailbox driver"); however, the AON implementation is still under development. This commit introduces a skeleton power-domain driver for the TH1520 SoC, designed to be easily extended to work with the AON protocol in the future. Currently, it only supports the GPU. Since there is no mechanism yet to turn the GPU power island on, the driver will only set the relevant registers to bring the GPU out of the reset state. This should be done after the power-up sequence requested through the mailbox is completed. Link: https://openbeagle.org/beaglev-ahead/beaglev-ahead/-/blob/main/docs/TH1520%20System%20User%20Manual.pdf [1] Signed-off-by: Michal Wilczynski --- MAINTAINERS | 2 + drivers/pmdomain/Kconfig | 1 + drivers/pmdomain/Makefile | 1 + drivers/pmdomain/thead/Kconfig | 12 ++ drivers/pmdomain/thead/Makefile | 2 + drivers/pmdomain/thead/th1520-pm-domains.c | 195 ++++++++++++++++++ .../dt-bindings/power/thead,th1520-power.h | 19 ++ 7 files changed, 232 insertions(+) create mode 100644 drivers/pmdomain/thead/Kconfig create mode 100644 drivers/pmdomain/thead/Makefile create mode 100644 drivers/pmdomain/thead/th1520-pm-domains.c create mode 100644 include/dt-bindings/power/thead,th1520-power.h diff --git a/MAINTAINERS b/MAINTAINERS index 2f8f529e6a31..16fb58aa74b1 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -20192,7 +20192,9 @@ F: drivers/clk/thead/ F: drivers/mailbox/mailbox-th1520.c F: drivers/net/ethernet/stmicro/stmmac/dwmac-thead.c F: drivers/pinctrl/pinctrl-th1520.c +F: drivers/pmdomain/thead/th1520-pm-domains.c F: include/dt-bindings/clock/thead,th1520-clk.h +F: include/dt-bindings/power/thead,th1520-power.h RNBD BLOCK DRIVERS M: Md. Haris Iqbal diff --git a/drivers/pmdomain/Kconfig b/drivers/pmdomain/Kconfig index 23c64851a5b0..91f04ace35d4 100644 --- a/drivers/pmdomain/Kconfig +++ b/drivers/pmdomain/Kconfig @@ -16,6 +16,7 @@ source "drivers/pmdomain/st/Kconfig" source "drivers/pmdomain/starfive/Kconfig" source "drivers/pmdomain/sunxi/Kconfig" source "drivers/pmdomain/tegra/Kconfig" +source "drivers/pmdomain/thead/Kconfig" source "drivers/pmdomain/ti/Kconfig" source "drivers/pmdomain/xilinx/Kconfig" diff --git a/drivers/pmdomain/Makefile b/drivers/pmdomain/Makefile index a68ece2f4c68..7030f44a49df 100644 --- a/drivers/pmdomain/Makefile +++ b/drivers/pmdomain/Makefile @@ -14,6 +14,7 @@ obj-y += st/ obj-y += starfive/ obj-y += sunxi/ obj-y += tegra/ +obj-y += thead/ obj-y += ti/ obj-y += xilinx/ obj-y += core.o governor.o diff --git a/drivers/pmdomain/thead/Kconfig b/drivers/pmdomain/thead/Kconfig new file mode 100644 index 000000000000..8a063b3b96f3 --- /dev/null +++ b/drivers/pmdomain/thead/Kconfig @@ -0,0 +1,12 @@ +# SPDX-License-Identifier: GPL-2.0-only + +config TH1520_PM_DOMAINS + bool "Support TH1520 Power Domains" + depends on ARCH_THEAD || COMPILE_TEST + select REGMAP_MMIO + help + This driver enables power domain management for the T-HEAD + TH-1520 SoC. On this SoC there are number of power domains, + which can be managed independently. For example GPU, AUDIO, + NPU, DPU reside in their own power domains which can be + turned on/off. diff --git a/drivers/pmdomain/thead/Makefile b/drivers/pmdomain/thead/Makefile new file mode 100644 index 000000000000..adfdf5479c68 --- /dev/null +++ b/drivers/pmdomain/thead/Makefile @@ -0,0 +1,2 @@ +# SPDX-License-Identifier: GPL-2.0-only +obj-$(CONFIG_TH1520_PM_DOMAINS) += th1520-pm-domains.o diff --git a/drivers/pmdomain/thead/th1520-pm-domains.c b/drivers/pmdomain/thead/th1520-pm-domains.c new file mode 100644 index 000000000000..60bdd011b017 --- /dev/null +++ b/drivers/pmdomain/thead/th1520-pm-domains.c @@ -0,0 +1,195 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2021 Alibaba Group Holding Limited. + * Copyright (c) 2024 Samsung Electronics Co., Ltd. + * Author: Michal Wilczynski + */ + +#include +#include +#include +#include +#include +#include + +#include + +/* register offset in VOSYS_REGMAP */ +#define TH1520_GPU_RST_CFG 0x0 +#define TH1520_GPU_RST_CFG_MASK GENMASK(2, 0) + +/* register values */ +#define TH1520_GPU_SW_GPU_RST BIT(0) +#define TH1520_GPU_SW_CLKGEN_RST BIT(1) + +struct th1520_power_domain { + struct regmap *reg; + struct generic_pm_domain genpd; + u32 rsrc; +}; + +struct th1520_power_info { + char *name; + u32 rsrc; +}; + +static const struct th1520_power_info th1520_pd_ranges[] = { + { "gpu", TH1520_AON_GPU_PD } +}; + +static inline struct th1520_power_domain * +to_th1520_power_domain(struct generic_pm_domain *genpd) +{ + return container_of(genpd, struct th1520_power_domain, genpd); +} + +static void th1520_rst_gpu_enable(struct regmap *reg) +{ + int val; + + /* if the GPU is not in a reset state it, put it into one */ + regmap_read(reg, TH1520_GPU_RST_CFG, &val); + if (val) { + regmap_update_bits(reg, TH1520_GPU_RST_CFG, + TH1520_GPU_RST_CFG_MASK, 0x0); + } + + /* rst gpu clkgen */ + regmap_set_bits(reg, TH1520_GPU_RST_CFG, TH1520_GPU_SW_CLKGEN_RST); + /* rst gpu */ + regmap_set_bits(reg, TH1520_GPU_RST_CFG, TH1520_GPU_SW_GPU_RST); +} + +static void th1520_rst_gpu_disable(struct regmap *reg) +{ + regmap_update_bits(reg, TH1520_GPU_RST_CFG, TH1520_GPU_RST_CFG_MASK, 0x0); +} + +static int th1520_pd_power_on(struct generic_pm_domain *domain) +{ + struct th1520_power_domain *pd = to_th1520_power_domain(domain); + + /* The missing component here is the call to E902 core through the + * AON protocol using hardware mailbox. + */ + + /* Initially after the power up the GPU and GPU clocks are + * in the reset state. Get them from that state to normal operation. + */ + th1520_rst_gpu_enable(pd->reg); + + return 0; +} + +static int th1520_pd_power_off(struct generic_pm_domain *domain) +{ + struct th1520_power_domain *pd = to_th1520_power_domain(domain); + + /* The missing component here is the call to E902 core through the + * AON protocol using hardware mailbox. + */ + + /* Put the GPU into reset state after powering it off */ + th1520_rst_gpu_disable(pd->reg); + + return 0; +} + +static struct generic_pm_domain *th1520_pd_xlate(const struct of_phandle_args *spec, + void *data) +{ + struct generic_pm_domain *domain = ERR_PTR(-ENOENT); + struct genpd_onecell_data *pd_data = data; + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(th1520_pd_ranges); i++) { + struct th1520_power_domain *pd; + + pd = to_th1520_power_domain(pd_data->domains[i]); + if (pd->rsrc == spec->args[0]) { + domain = &pd->genpd; + break; + } + } + + return domain; +} + +static struct th1520_power_domain * +th1520_add_pm_domain(struct device *dev, const struct th1520_power_info *pi) +{ + struct th1520_power_domain *pd; + int ret; + + pd = devm_kzalloc(dev, sizeof(*pd), GFP_KERNEL); + if (!pd) + return ERR_PTR(-ENOMEM); + + pd->rsrc = pi->rsrc; + pd->genpd.power_on = th1520_pd_power_on; + pd->genpd.power_off = th1520_pd_power_off; + pd->genpd.name = pi->name; + + ret = pm_genpd_init(&pd->genpd, NULL, true); + if (ret) { + devm_kfree(dev, pd); + return ERR_PTR(ret); + } + + return pd; +} + +static int th1520_pd_probe(struct platform_device *pdev) +{ + struct generic_pm_domain **domains; + struct genpd_onecell_data *pd_data; + struct device *dev = &pdev->dev; + struct device_node *np = dev->of_node; + struct regmap *reg; + int i; + + reg = syscon_regmap_lookup_by_phandle(np, "thead,vosys-regmap"); + if (IS_ERR(reg)) + return PTR_ERR(reg); + + domains = devm_kcalloc(dev, ARRAY_SIZE(th1520_pd_ranges), + sizeof(*domains), GFP_KERNEL); + if (!domains) + return -ENOMEM; + + pd_data = devm_kzalloc(dev, sizeof(*pd_data), GFP_KERNEL); + if (!pd_data) + return -ENOMEM; + + for (i = 0; i < ARRAY_SIZE(th1520_pd_ranges); i++) { + struct th1520_power_domain *pd; + + pd = th1520_add_pm_domain(dev, &th1520_pd_ranges[i]); + if (IS_ERR_OR_NULL(pd)) + continue; + + pd->reg = reg; + domains[i] = &pd->genpd; + dev_dbg(dev, "added power domain %s\n", pd->genpd.name); + } + + pd_data->domains = domains; + pd_data->num_domains = ARRAY_SIZE(th1520_pd_ranges); + pd_data->xlate = th1520_pd_xlate; + + return of_genpd_add_provider_onecell(dev->of_node, pd_data); +} + +static const struct of_device_id th1520_pd_match[] = { + { .compatible = "thead,th1520-pd",}, + { /* sentinel */ } +}; + +static struct platform_driver th1520_pd_driver = { + .driver = { + .name = "th1520-pd", + .of_match_table = th1520_pd_match, + }, + .probe = th1520_pd_probe, +}; +builtin_platform_driver(th1520_pd_driver); diff --git a/include/dt-bindings/power/thead,th1520-power.h b/include/dt-bindings/power/thead,th1520-power.h new file mode 100644 index 000000000000..30fb4e9892e7 --- /dev/null +++ b/include/dt-bindings/power/thead,th1520-power.h @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2022 Alibaba Group Holding Limited. + * Copyright (c) 2024 Samsung Electronics Co., Ltd. + * Author: Michal Wilczynski + */ + +#ifndef __DT_BINDINGS_POWER_TH1520_H +#define __DT_BINDINGS_POWER_TH1520_H + +#define TH1520_AON_AUDIO_PD 0 +#define TH1520_AON_VDEC_PD 1 +#define TH1520_AON_NPU_PD 2 +#define TH1520_AON_VENC_PD 3 +#define TH1520_AON_GPU_PD 4 +#define TH1520_AON_DSP0_PD 5 +#define TH1520_AON_DSP1_PD 6 + +#endif From patchwork Tue Dec 3 13:41:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Wilczynski X-Patchwork-Id: 847182 Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 31B7E1F6669 for ; Tue, 3 Dec 2024 13:42:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.118.77.12 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733233328; cv=none; b=htzwkbL93WLdKFYsXeu8sKIfsh1HKHXvL3nfsS5olqdZlvRZNiKtz8UfSUgLSH8PLFKNgxwLX2IVU5g+TOoFSnJmJinBnqGxc3FEudd1a0nR1YkdLwd/pH0qYhg6UP+yprqaYw6a5nREY46NMfgeeoay/BI60NpEqSV88vEunSA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733233328; c=relaxed/simple; bh=sDKPvWGxnHxVC0T32lC0HUTaPXo+NU3d+tnf4J88OFE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:MIME-Version: Content-Type:References; b=D9mC9/+oPcezsyvJ3WCjt9UBbqAX7ZFZKlEw/HwMqYoh2I2BgkhvNx5fiGSnnrlzjKOXFeqQndayzVBTloICzwQCWQpVcuqT8+gdtGUdwrzwsFW1AuHoh9Sw7Hrm1Z5hfOLVe9XEm6P6cURMZQugS9EegAFmLH9jjGJTT7grgOk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com; spf=pass smtp.mailfrom=samsung.com; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b=ZiXqqoMU; arc=none smtp.client-ip=210.118.77.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=samsung.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="ZiXqqoMU" Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20241203134200euoutp028749a3cb47f702acf437ac94b339ad60~NroWwnGG53035230352euoutp02h for ; Tue, 3 Dec 2024 13:42:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20241203134200euoutp028749a3cb47f702acf437ac94b339ad60~NroWwnGG53035230352euoutp02h DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1733233320; bh=EW8C3FY5YdJjEkS2Yc5HPO77Vz/fd2iQK7q2W6SPoFI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZiXqqoMUsPzAfHBAntt7aChmN5c8gU+R25xY/qjqpocjOwKUXeP9mRPV02ummPTNm ectZrtBcLmx6PPfSDvWyisOHasRG7XKcTjHo+WrXYsF6aJ4frzg9TBAH62pWcWegFX Xh4JggojA3qConjIk/8f4uAsMbQ5hZ1R3bvn8lmw= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20241203134159eucas1p2e233c85ff41d2e0af5ab47c7dd4287db~NroV7J0at1157511575eucas1p2s; Tue, 3 Dec 2024 13:41:59 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 89.CA.20821.7AA0F476; Tue, 3 Dec 2024 13:41:59 +0000 (GMT) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20241203134159eucas1p1eafefef0dfe7f2b6343a639733012bcf~NroVaZC7t3119131191eucas1p1D; Tue, 3 Dec 2024 13:41:59 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20241203134159eusmtrp180a93901ed8e82f9f619033779cce93c~NroVZgGeV0887308873eusmtrp1Q; Tue, 3 Dec 2024 13:41:59 +0000 (GMT) X-AuditID: cbfec7f2-b09c370000005155-78-674f0aa7012c Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id B1.07.19654.7AA0F476; Tue, 3 Dec 2024 13:41:59 +0000 (GMT) Received: from AMDC4942.home (unknown [106.210.136.40]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20241203134157eusmtip2c106e0c8996c77f30060740310e5e13f~NroUGITQL2454624546eusmtip2M; Tue, 3 Dec 2024 13:41:57 +0000 (GMT) From: Michal Wilczynski To: mturquette@baylibre.com, sboyd@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, drew@pdp7.com, guoren@kernel.org, wefu@redhat.com, jassisinghbrar@gmail.com, paul.walmsley@sifive.com, palmer@dabbelt.com, aou@eecs.berkeley.edu, frank.binns@imgtec.com, matt.coster@imgtec.com, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, simona@ffwll.ch, ulf.hansson@linaro.org, jszhang@kernel.org, m.szyprowski@samsung.com Cc: linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, dri-devel@lists.freedesktop.org, linux-pm@vger.kernel.org, Michal Wilczynski Subject: [RFC PATCH v1 08/14] dt-bindings: power: thead,th1520: Add support for power domains Date: Tue, 3 Dec 2024 14:41:31 +0100 Message-Id: <20241203134137.2114847-9-m.wilczynski@samsung.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241203134137.2114847-1-m.wilczynski@samsung.com> Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA02Se0xTZxjG851zes6hpnAobHxjGJFFic6BNSz7jKCyuOVMXNRdMmFLsIGz ygaFtYLbNBsIlMsKkxVYrJbb5CIRmFwqVC4ZFCpjwICBZQNEw60ULVejc5FRDm7+93ve93m/ 532Tj8bF1aQ7HSE/zSnk0kgvUkjoOx73vlYqPCrbPXltN7p1uwhDdU+0FLrW1IOhfGOPAI31 12LojxUbiSonf6fQTFMCgYbKdBRK7KgikUU7RqIF9ZgADRguk2gpwwiQfimJRBXGUQpVreRj qHChjkBX6g0AqdJKBKjv17eQZUCNI5XWCa021lPo6dB1Al160EKh2rksATJVfISSWrKJg5tZ mzmZYucsFoJtS12m2KaHBQTboB2lWHXDb4Ct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UM5SfnlViKMxIN tZiLihMB3TtOWLUDAAA= X-CMS-MailID: 20241203134159eucas1p1eafefef0dfe7f2b6343a639733012bcf X-Msg-Generator: CA X-RootMTR: 20241203134159eucas1p1eafefef0dfe7f2b6343a639733012bcf X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20241203134159eucas1p1eafefef0dfe7f2b6343a639733012bcf References: <20241203134137.2114847-1-m.wilczynski@samsung.com> Add power domain support to the Thead TH1520 clock controller bindings. This enables devices to specify their power domain dependencies, improving power management for components like the GPU. Signed-off-by: Michal Wilczynski --- .../bindings/power/thead,th1520-power.yaml | 52 +++++++++++++++++++ MAINTAINERS | 1 + 2 files changed, 53 insertions(+) create mode 100644 Documentation/devicetree/bindings/power/thead,th1520-power.yaml diff --git a/Documentation/devicetree/bindings/power/thead,th1520-power.yaml b/Documentation/devicetree/bindings/power/thead,th1520-power.yaml new file mode 100644 index 000000000000..528af54f4ca6 --- /dev/null +++ b/Documentation/devicetree/bindings/power/thead,th1520-power.yaml @@ -0,0 +1,52 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/power/thead,th1520-power.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: T-HEAD TH1520 Power Domain Controller + +maintainers: + - Michal Wilczynski + +description: | + The T-HEAD TH1520 SoC includes a power domain controller responsible for + managing the power states of various hardware domains such as the GPU. + + This binding describes the power domain controller node, which can be used by + devices to manage their power domains. + +properties: + compatible: + const: "thead,th1520-pd" + + thead,vosys-regmap: + $ref: /schemas/types.yaml#/definitions/phandle + description: | + Phandle to a syscon node representing the shared register space of the VO (Video Output) subsystem. + This register space includes both clock control registers and other control registers used for + operations like resetting the GPU. Since these registers reside in the same address space, + access to them is coordinated through a shared syscon regmap provided by the specified syscon node. + + '#power-domain-cells': + const: 1 + +required: + - compatible + - thead,vosys-regmap + - '#power-domain-cells' + +additionalProperties: false + +examples: + - | + vosys_regmap: vosys@ffef528000 { + compatible = "syscon"; + reg = <0xff 0xef528000 0x0 0x1000>; + }; + + power-controller { + compatible = "thead,th1520-pd"; + thead,vosys-regmap = <&vosys_regmap>; + #power-domain-cells = <1>; + }; diff --git a/MAINTAINERS b/MAINTAINERS index 16fb58aa74b1..acbe311087ad 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -20187,6 +20187,7 @@ F: Documentation/devicetree/bindings/clock/thead,th1520-clk.yaml F: Documentation/devicetree/bindings/mailbox/thead,th1520-mbox.yaml F: Documentation/devicetree/bindings/net/thead,th1520-gmac.yaml F: Documentation/devicetree/bindings/pinctrl/thead,th1520-pinctrl.yaml +F: Documentation/devicetree/bindings/power/thead,th1520-power.yaml F: arch/riscv/boot/dts/thead/ F: drivers/clk/thead/ F: drivers/mailbox/mailbox-th1520.c From patchwork Tue Dec 3 13:41:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Wilczynski X-Patchwork-Id: 847528 Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 66E6F1F4733 for ; Tue, 3 Dec 2024 13:42:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.118.77.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733233331; cv=none; b=PQeMloaGHkLFgwaszTmRoywcvoFpupMTl4QK0th6R8z5CWkKzojLCCOsD6d77OniO4QidXtqyGkH9HbG88yuU9ISo1+NHb5ehbeVpG16QwZBc56XF0iDaIGZ8hMlyzlomZLntdN/eVjWQhmhW5w+CTP6ny0Y8ovY7E/S72opzqw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733233331; c=relaxed/simple; bh=AvOuBhpS/RO4n/V2TKEgU+sci1oVNo2VYWPMwnRe7lc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:MIME-Version: Content-Type:References; b=oBeN58YbgdKhTT3cj8jOCI+2B1CDAFs1hCszFdYYk4SfxEeFOMV4QOpuRmdNXJVYVhNXIXs/by0DdPJeCYaLDLOQfFEE2cE14FCxcLs3gelY82+Xt+xR3yDCqcXZxrmpNgITdGupI0a7DB6utyRZr8rC4dHEiOcPW05LgpXlhNk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com; spf=pass smtp.mailfrom=samsung.com; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b=Laz41T5+; arc=none smtp.client-ip=210.118.77.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=samsung.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="Laz41T5+" Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20241203134201euoutp01053946d1fec672b9a2a1370359526a5b~NroXuzlYV2559325593euoutp01a for ; Tue, 3 Dec 2024 13:42:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20241203134201euoutp01053946d1fec672b9a2a1370359526a5b~NroXuzlYV2559325593euoutp01a DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1733233321; bh=db70OtbkcGzgNDsJliSTwbkZ7rSF5HHS/kqbDimn6GA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Laz41T5+HmPMIG+67C62UYZmxkD2bCiCaEraeVi+LK/lqaoagaauHUIghzbATyfai P9JFLsCvVMDuQPax1Irbjb8UnfHKOk0Uro5fJBQcnq8NSjEpPglYChhZ+sORD93ISI FBkt7YSEMJEyEe8xelhOA9LAsKgEcVw/FzD8Sgbk= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20241203134201eucas1p2acef324be66dffaec3a120a1b4da68ad~NroXMQ7zH2525425254eucas1p2C; Tue, 3 Dec 2024 13:42:01 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id FC.CA.20821.9AA0F476; Tue, 3 Dec 2024 13:42:01 +0000 (GMT) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20241203134200eucas1p25a1f81ea1ce3f10d507be381da750b31~NroWsSPli0763507635eucas1p25; Tue, 3 Dec 2024 13:42:00 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20241203134200eusmtrp15f1e86e10afeadabdf4b8e4062a35b0e~NroWrSGoh0887308873eusmtrp1T; Tue, 3 Dec 2024 13:42:00 +0000 (GMT) X-AuditID: cbfec7f2-b09c370000005155-80-674f0aa9bd57 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id A3.D8.19920.8AA0F476; Tue, 3 Dec 2024 13:42:00 +0000 (GMT) Received: from AMDC4942.home (unknown [106.210.136.40]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20241203134159eusmtip220458ce3abcd87999c00db6ae33bca7d~NroVWYeUR3160631606eusmtip2F; Tue, 3 Dec 2024 13:41:59 +0000 (GMT) From: Michal Wilczynski To: mturquette@baylibre.com, sboyd@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, drew@pdp7.com, guoren@kernel.org, wefu@redhat.com, jassisinghbrar@gmail.com, paul.walmsley@sifive.com, palmer@dabbelt.com, aou@eecs.berkeley.edu, frank.binns@imgtec.com, matt.coster@imgtec.com, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, simona@ffwll.ch, ulf.hansson@linaro.org, jszhang@kernel.org, m.szyprowski@samsung.com Cc: linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, dri-devel@lists.freedesktop.org, linux-pm@vger.kernel.org, Michal Wilczynski Subject: [RFC PATCH v1 09/14] riscv: Enable PM_GENERIC_DOMAINS for T-Head SoCs Date: Tue, 3 Dec 2024 14:41:32 +0100 Message-Id: <20241203134137.2114847-10-m.wilczynski@samsung.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241203134137.2114847-1-m.wilczynski@samsung.com> Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA01SbUxTVxje6b29tzQpuxScJyBhYFDcXFH2dQzoWDLjTVxQYgbZh9k6uKmk fNmCk8kCXaETKIvjQ7YCK1gY0IENtVToBDaGdICCKF/O2rEp2ypUBIQNR2BtL27+e97nfZ73 ed+Tw8OErYQ/Lyk1g5GlipNDCD5u7lsZfqGJf0iyq8IgQD9NnOOgtn80JGruHOIgbe8QF9mv mzhodGmOQOenr5Hoz04FjsYbq0mk7DMQyKGxE2hebeeiG5YqAi0W9wJkXswjUEvvbRIZlrQc VDvfhqO6dgtAqoJvuGhkYD9y3FBjSKV5Gq1faifR2ngrjirvd5PINPsFF1lb4lFedxkeHUjP TeaT9KzDgdM/nn5I0p3LNTjdoblN0uqOK4A26gsI2jZ+iaC/7o+lfymycugLdTl0Xksfh57r GiPoz016QF9XTpD0hcFTh33e4UclMslJJxhZ+L4P+Mcum5ux9DKvk3kVzWQuGCQLgRcPUi9B Y6Xdhfk8IdUIYIlzAGOLhwC26PIwt0pILQI4YPV+7LD1V2zwDQB+O/s2a5gFsG70Z89YgoqA Uw1arrvhR81gcHLp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4861PWwe804GetzvPs7ksXlJvUfL2mNMHu/3XWXz6NuyitHj UvN1do/Np6sDBKP0bIryS0tSFTLyi0tslaINLYz0DC0t9IxMLPUMjc1jrYxMlfTtbFJSczLL Uov07RL0Mo5uW8NcMIWzomX6GvYGxtPsXYycHBICJhJ3Tk5n7mLk4hASWMoo0d/wmRkiISNx rfslC4QtLPHnWhcbRNErRomzW/+zgSTYBIwkHiyfzwqSEBHoZJF4u3ktI4jDLPCWUeL6zI1g 7cICfhKPJveD2SwCqhLveqeBreAVcJDo/DmbEWKFvMT+g2fB4pxA8ddTu1hBbCEBe4kdfw+z QtQLSpyc+QRsDjNQffPW2cwTGAVmIUnNQpJawMi0ilEktbQ4Nz232FCvODG3uDQvXS85P3cT IzCxbDv2c/MOxnmvPuodYmTiYDzEKMHBrCTCu3y9d7oQb0piZVVqUX58UWlOavEhRlOguycy S4km5wNTW15JvKGZgamhiZmlgamlmbGSOK/b5fNpQgLpiSWp2ampBalFMH1MHJxSDUyhlzbk 6em5h31P+JIcvqD/q9eXnOUazwomBqtPLpn5fovj519pjk8nZuSLxgiwyoVKTOzP2HSC/c7H 9u/8KW5qNqsnhc96mDHrvnLj/1r1OZ45ynm8a9ZI2GwsjC3UW/f9ykkXvogn9zrTNkgmLkk7 rKy/svl1lbPiv7cP2uvuzcq/IzF/reXMmZevlbbnT76cfmaKImt7pQuH6JbT+xNfhHM3Rkx1 W3S61HFWQW30piaTJ+5ecyzz/a5tncAfrtySmflmeV31jCPMvV+mRIVtLPU3mXD/dTNzWo5E cXh+5WLtI7viv72+t65xkWCwXvNepZ9C6bLL9k709D1zbf9En6jCjoJ3TwtO9ymlpiixFGck GmoxFxUnAgCBrnbPtQMAAA== X-CMS-MailID: 20241203134200eucas1p25a1f81ea1ce3f10d507be381da750b31 X-Msg-Generator: CA X-RootMTR: 20241203134200eucas1p25a1f81ea1ce3f10d507be381da750b31 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20241203134200eucas1p25a1f81ea1ce3f10d507be381da750b31 References: <20241203134137.2114847-1-m.wilczynski@samsung.com> T-Head SoCs feature separate power domains (power islands) for major components like the GPU, Audio, and NPU. To manage the power states of these components effectively, the kernel requires generic power domain support. This commit enables `CONFIG_PM_GENERIC_DOMAINS` for T-Head SoCs, allowing the power domain driver for these components to be compiled and integrated. This ensures proper power management and energy efficiency on T-Head platforms. By selecting `PM_GENERIC_DOMAINS`, we provide the necessary framework for the power domain drivers to function correctly on RISC-V architecture with T-Head SoCs. Signed-off-by: Michal Wilczynski --- arch/riscv/Kconfig.socs | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/riscv/Kconfig.socs b/arch/riscv/Kconfig.socs index f51bb24bc84c..c414dc618b66 100644 --- a/arch/riscv/Kconfig.socs +++ b/arch/riscv/Kconfig.socs @@ -48,6 +48,7 @@ config ARCH_THEAD bool "T-HEAD RISC-V SoCs" depends on MMU && !XIP_KERNEL select ERRATA_THEAD + select PM_GENERIC_DOMAINS if PM help This enables support for the RISC-V based T-HEAD SoCs. From patchwork Tue Dec 3 13:41:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Wilczynski X-Patchwork-Id: 847180 Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7C5731F1307 for ; Tue, 3 Dec 2024 13:42:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.118.77.12 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733233331; cv=none; b=XVPIIXDRzwp1E+QKQbG9/EKnDCD96MRVYpYFlqtKjjoPpWXRhET98rMODDRbJC88VAxlq7U1XW+yM5yqw/eZxb47wEwiplhfduOB+c6Il6gbM2340cEIfmV3ElEAEvXs5DYpBPTubkQfC6gQ66WpBOh3wtJ0AMup8yhZDogfGUA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733233331; c=relaxed/simple; bh=LGeuU1gvSlUDj4IGxOzNM8mvaHEFlSPXotB2cBgCBrc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:MIME-Version: Content-Type:References; b=l+dpsW/sAD7voDgkTEGD/BYpndnIfKusSRRbAxMPsd4u7z/DuecR7mJUDEyT3hNoggJQIJNJxZBfM+ZpfLxEdVXs3Let2zhayPEqHjQf2DD6TqL6ztY7Sinz6qLWqd/ge0b+t7VqisW1dhNJGJLOGhsZ9YCKgVMKYFagUQ2H7+Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com; spf=pass smtp.mailfrom=samsung.com; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b=TrBeCDr6; arc=none smtp.client-ip=210.118.77.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=samsung.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="TrBeCDr6" Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20241203134203euoutp0252dc452ef1e5094c5f4aa2788c2e2587~NroY8BQ_z3036030360euoutp02e for ; Tue, 3 Dec 2024 13:42:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20241203134203euoutp0252dc452ef1e5094c5f4aa2788c2e2587~NroY8BQ_z3036030360euoutp02e DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1733233323; bh=C1YLKXMYJWNZMzoNJUKXej7WlTB7xuYAcg1TSDjxMiY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TrBeCDr6GBchQjRh8i0P6OPbiql4ArAsTRAXMdW77Kiki3oqfbxKr9CCg/BMb8ZIu ZVVzljO1Iiu4r3CLa12rFx7IJwiQb9i4O9LbxAiS2cZHrGQdGHZ+621h4LpUu2x/vj j/4jGIO5KHqGgOP0M26JclfL6atIDnEaq9pivJ7Q= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20241203134202eucas1p13d3e780c1032802d499834a2bce8b35c~NroYWlNp_3153231532eucas1p1C; Tue, 3 Dec 2024 13:42:02 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id E9.8F.20409.AAA0F476; Tue, 3 Dec 2024 13:42:02 +0000 (GMT) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20241203134202eucas1p26bdcec486ee42440ded94ff801678ba0~NroX52d1g2020620206eucas1p2J; Tue, 3 Dec 2024 13:42:02 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20241203134202eusmtrp256be97aceec313eaab0d31b20d247ded~NroX4_iV_3025130251eusmtrp2R; Tue, 3 Dec 2024 13:42:02 +0000 (GMT) X-AuditID: cbfec7f4-c39fa70000004fb9-97-674f0aaa8e05 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 96.D8.19920.9AA0F476; Tue, 3 Dec 2024 13:42:01 +0000 (GMT) Received: from AMDC4942.home (unknown [106.210.136.40]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20241203134200eusmtip2c8f6618d426dbca2d7ad94b36f2e1bc3~NroWljBDI3160631606eusmtip2G; Tue, 3 Dec 2024 13:42:00 +0000 (GMT) From: Michal Wilczynski To: mturquette@baylibre.com, sboyd@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, drew@pdp7.com, guoren@kernel.org, wefu@redhat.com, jassisinghbrar@gmail.com, paul.walmsley@sifive.com, palmer@dabbelt.com, aou@eecs.berkeley.edu, frank.binns@imgtec.com, matt.coster@imgtec.com, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, simona@ffwll.ch, ulf.hansson@linaro.org, jszhang@kernel.org, m.szyprowski@samsung.com Cc: linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, dri-devel@lists.freedesktop.org, linux-pm@vger.kernel.org, Michal Wilczynski Subject: [RFC PATCH v1 10/14] drm/imagination: Add support for IMG BXM-4-64 GPU Date: Tue, 3 Dec 2024 14:41:33 +0100 Message-Id: <20241203134137.2114847-11-m.wilczynski@samsung.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241203134137.2114847-1-m.wilczynski@samsung.com> Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA01Se1BUZRyd79679152WrqsIN+ARu6EFDMgOM30GUX0QO9MM5TkZDWULnED iueuhBiNBgsI7O7AhqUrBhi6tBNuvHZ4ijxiI2yFVRYyHhZorKKIsAWh0C53Lf87v3PO7zvn N/PRuLiO9KETUw5wshRpkoQUEsa+ZXOQXvhGfEhRgS/6aeQ0hppWtBT6vsOMoYpeswBNWBox dMU+R6Jz1wcpNNPxBYGsNacolNtnIJFNO0GieeWEAF1uLSfRgqoXIOOCgkS1veMUMtgrMFQ1 30Sg6uZWgPILzwrQ0M+RyHZZiaN87eNorb2ZQqvWOgKdvNNJocbZUgEy1e5Fis4yImIzOzea R7GzNhvB9hxdpNiOvyoJtkU7TrHKlouArdcXkuyYtZ1kv+nfzU4WmzC2ofowq6jtw9i588Mk q27UA9aSO0KxDQOfvenxnvCFOC4p8VN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440ded94ff801678ba0 X-Msg-Generator: CA X-RootMTR: 20241203134202eucas1p26bdcec486ee42440ded94ff801678ba0 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20241203134202eucas1p26bdcec486ee42440ded94ff801678ba0 References: <20241203134137.2114847-1-m.wilczynski@samsung.com> The IMG BXM-4-64 GPU is integrated into the T-Head TH1520 SoC. This commit adds the compatible string "img,img-bxm-4-64" to the device tree match table in the drm/imagination driver, enabling support for this GPU. By including this GPU in the compatible devices list, the driver can initialize and manage the BXM-4-64 GPU on the TH1520 SoC, providing graphics acceleration capabilities upstream. This commit doesn't touch the img,powervr-rogue.yaml on purpose, as the new dt-bindings schema was proposed [1], but not merged yet. Link: https://lore.kernel.org/all/20241118-sets-bxs-4-64-patch-v1-v2-1-3fd45d9fb0cf@imgtec.com/ [1] Signed-off-by: Michal Wilczynski --- drivers/gpu/drm/imagination/pvr_drv.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/imagination/pvr_drv.c b/drivers/gpu/drm/imagination/pvr_drv.c index 85ee9abd1811..8633a3a315b7 100644 --- a/drivers/gpu/drm/imagination/pvr_drv.c +++ b/drivers/gpu/drm/imagination/pvr_drv.c @@ -1475,6 +1475,7 @@ static void pvr_remove(struct platform_device *plat_dev) static const struct of_device_id dt_match[] = { { .compatible = "img,img-axe", .data = NULL }, + { .compatible = "img,img-bxm-4-64", .data = NULL }, {} }; MODULE_DEVICE_TABLE(of, dt_match); From patchwork Tue Dec 3 13:41:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Wilczynski X-Patchwork-Id: 847181 Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A227B1F6694 for ; Tue, 3 Dec 2024 13:42:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.118.77.12 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733233331; cv=none; b=umcJFLNaiAnXDpeuP6bR5aZGI0gZQbv8JyD045+ESHS2a6g0Hr7tEDjScdYe56X1AVX7XBt2+L4o+1UER1GnM63sxNdqe+sE10H9NBTd51poV7flyjD9brj4gEhzHUj4Jp0sIIY/W1q5YSXBl3C+CT57LkQO6IKdvvdCHzbmpHg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733233331; c=relaxed/simple; bh=74GQQ1iARGV4ZZF6Ipw2I6AC9+HTNWo1SPXdL5hc2yc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:MIME-Version: Content-Type:References; b=K4lB+HHl94n2SoJ7I32Zm9JAbHMF13aBwra5+/07MRGEcD4GrgZO4fojm2ag0VRDHEDQiGsRdDBlOsXU0ZR06q6Io5VXJa6SfUg/3qSRVvT2/lwkN/b3isvIPB2DaN02esOHoczXACswY+6RhzFbJK+jzF5HDXVtJVJQX9gvLC8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com; spf=pass smtp.mailfrom=samsung.com; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b=NFZj3W56; arc=none smtp.client-ip=210.118.77.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=samsung.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="NFZj3W56" Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20241203134204euoutp02e7ca691fb9881acde8fdcb98204150e7~NroaZg1vX0144901449euoutp02R for ; Tue, 3 Dec 2024 13:42:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20241203134204euoutp02e7ca691fb9881acde8fdcb98204150e7~NroaZg1vX0144901449euoutp02R DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1733233324; bh=DgeFHCAIbeFBF+0nDHhjAGX/VqaqfX2KAeQLuxONDpc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NFZj3W56ljtXnHvc1tmGFjM5qZGLUbULsATE25DYlUfR8PmHWh5XBugSUbSkHTo08 Cmf06iPw+f5tBMp8R1PeseCefC0rYvp5MdArlhxQPmoouTsihyq1f11dOpljrg4D2Y ooHh0yjmlH2gKI0u/kHlojVBFmUXvseZ7zkUV/Go= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20241203134203eucas1p1bdae5662b85b434acdc7f54e36d382ed~NroZpJgjr2516025160eucas1p1G; Tue, 3 Dec 2024 13:42:03 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 5C.8F.20409.BAA0F476; Tue, 3 Dec 2024 13:42:03 +0000 (GMT) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20241203134203eucas1p11a2e36f777af362a333d8865bcb5d34e~NroZNpAIw1266212662eucas1p1-; Tue, 3 Dec 2024 13:42:03 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20241203134203eusmtrp1e72591d8410ed2d962a249230bcc7207~NroZG6yke0887308873eusmtrp1c; Tue, 3 Dec 2024 13:42:03 +0000 (GMT) X-AuditID: cbfec7f4-c39fa70000004fb9-9b-674f0aab1bb6 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 2A.D8.19920.BAA0F476; Tue, 3 Dec 2024 13:42:03 +0000 (GMT) Received: from AMDC4942.home (unknown [106.210.136.40]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20241203134201eusmtip29d9c18c2428730d69c4023606adce934~NroXzhmyc3133331333eusmtip2j; Tue, 3 Dec 2024 13:42:01 +0000 (GMT) From: Michal Wilczynski To: mturquette@baylibre.com, sboyd@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, drew@pdp7.com, guoren@kernel.org, wefu@redhat.com, jassisinghbrar@gmail.com, paul.walmsley@sifive.com, palmer@dabbelt.com, aou@eecs.berkeley.edu, frank.binns@imgtec.com, matt.coster@imgtec.com, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, simona@ffwll.ch, ulf.hansson@linaro.org, jszhang@kernel.org, m.szyprowski@samsung.com Cc: linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, dri-devel@lists.freedesktop.org, linux-pm@vger.kernel.org, Michal Wilczynski Subject: [RFC PATCH v1 11/14] drm/imagination: Enable PowerVR driver for RISC-V Date: Tue, 3 Dec 2024 14:41:34 +0100 Message-Id: <20241203134137.2114847-12-m.wilczynski@samsung.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241203134137.2114847-1-m.wilczynski@samsung.com> Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA02Sf1CTdRzH+T7Ps+d5WDd6GHj7ShAnBld2oiJn38vqMLWezlDpnzrO0p08 zQkM3ByZesmvFtAoSBg5SBYh0BBJxhYsafLjmLBcCIUQ8qOLMGS5kB9XGayNB8v/Xp/35/25 9+dz96FxcRMZQssVxzmlQpoSQQoJS/dfzo31wn2yzSOeLejazSoMme/rKXSxzYmhyi6nAI31 N2PohwU3iS792keh39qyCDRY9xmFc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fkUhheuFZ7HY7 tTfjt/7vs8vcnrxuXd9j8MFxl4Jz/fTr4tPYPEy6jluL3XttMjN705ZP8x6+i9Ba6Sxfl9u2 97yYEteqRW98cm4vr/11Je1D6tGoQKtv77lXXfav+bU+bpn5tHlOX6YdKzp79DfbXyWW4oxE Qy3mouJEAFZ2wvS1AwAA X-CMS-MailID: 20241203134203eucas1p11a2e36f777af362a333d8865bcb5d34e X-Msg-Generator: CA X-RootMTR: 20241203134203eucas1p11a2e36f777af362a333d8865bcb5d34e X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20241203134203eucas1p11a2e36f777af362a333d8865bcb5d34e References: <20241203134137.2114847-1-m.wilczynski@samsung.com> Several RISC-V boards feature Imagination GPUs that are compatible with the PowerVR driver. An example is the IMG BXM-4-64 GPU on the Lichee Pi 4A board. This commit adjusts the driver's Kconfig dependencies to allow the PowerVR driver to be compiled on the RISC-V architecture. By enabling compilation on RISC-V, we expand support for these GPUs, providing graphics acceleration capabilities and enhancing hardware compatibility on RISC-V platforms. Signed-off-by: Michal Wilczynski --- drivers/gpu/drm/imagination/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/imagination/Kconfig b/drivers/gpu/drm/imagination/Kconfig index 3bfa2ac212dc..5f218896114c 100644 --- a/drivers/gpu/drm/imagination/Kconfig +++ b/drivers/gpu/drm/imagination/Kconfig @@ -3,7 +3,7 @@ config DRM_POWERVR tristate "Imagination Technologies PowerVR (Series 6 and later) & IMG Graphics" - depends on ARM64 + depends on (ARM64 || RISCV) depends on DRM depends on PM select DRM_EXEC From patchwork Tue Dec 3 13:41:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Wilczynski X-Patchwork-Id: 847529 Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A8E3E1F6697 for ; Tue, 3 Dec 2024 13:42:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.118.77.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733233331; cv=none; b=YaRl/K4Ys2p5CrY5OmO0xJUenVp4eTKc0T/n3RMD7vMasUp/GVXKYa9xl7yWSoJjF7etqAKV1xEoG7HsgKBEYbk0fHJ6Rr2MIOYU/gBpObZW2YKWrHjapnXuhejuJmXEzfl+1HSVgcVzqRmfwWid7bQ0TvMUbzEppSyldXYHC8o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733233331; c=relaxed/simple; bh=yGV+pHT8Eu+bW/k22z4ah+jmkMn/dSKIhyug2nfL/QM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:MIME-Version: Content-Type:References; b=ofNDRPOvt6yjL1EngRCVCuZvfWSQrChSsn6YsRBEF6Vlgl8kXk8eST8fkTjFr2vdKFLihTRAh5ynF6hYm7gLFzPbZAJ1rd06c42kmFSnxTnoYhmXEpaKKAypM6uQsWEJA9KLDprLz9qP5PBTw8BE9rmry6VL2C9FAUmKR5IMf+U= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com; spf=pass smtp.mailfrom=samsung.com; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b=gNlUsS+Z; arc=none smtp.client-ip=210.118.77.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=samsung.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="gNlUsS+Z" Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20241203134205euoutp0129fa681f94686d64208310032a6422d0~NrobSipcc2577425774euoutp01L for ; Tue, 3 Dec 2024 13:42:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20241203134205euoutp0129fa681f94686d64208310032a6422d0~NrobSipcc2577425774euoutp01L DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1733233325; bh=Y3IPk+omdIsYG1TGGWrZ/T1oqXdwsq6W+jVj4/QfyRY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gNlUsS+Z9h2yWFNZS2nNcX57QOifuflBK55wqPStgWPKkB5qMT2k7Uy7NoPFAbtig JVHJMAhhso50rEcAZ0k7BBJqs1bytJLWCgdC6SQFq7m3Dr26Ng0GRsoi1VclxllZ1i 3oEKagF1qyroHxPI1Y6j48gcuHMvKboQQeNWyJrM= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20241203134205eucas1p1ff5c636d9a33263759a1ac385dc8f85b~NroayyaeB2130021300eucas1p1D; Tue, 3 Dec 2024 13:42:05 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id FE.8F.20409.DAA0F476; Tue, 3 Dec 2024 13:42:05 +0000 (GMT) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20241203134204eucas1p1d0df90a265637542f0652fd407dc7989~NroaVss8-3146231462eucas1p1G; Tue, 3 Dec 2024 13:42:04 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20241203134204eusmtrp1ac1235c6c147940e07b68dcf5c7030b5~NroaU3SMa0888908889eusmtrp1Y; Tue, 3 Dec 2024 13:42:04 +0000 (GMT) X-AuditID: cbfec7f4-c39fa70000004fb9-a3-674f0aad0002 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id BC.D8.19920.CAA0F476; Tue, 3 Dec 2024 13:42:04 +0000 (GMT) Received: from AMDC4942.home (unknown [106.210.136.40]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20241203134203eusmtip219f716cf08acc535a4afb581580bd4b1~NroZCcx8K0887608876eusmtip2C; Tue, 3 Dec 2024 13:42:03 +0000 (GMT) From: Michal Wilczynski To: mturquette@baylibre.com, sboyd@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, drew@pdp7.com, guoren@kernel.org, wefu@redhat.com, jassisinghbrar@gmail.com, paul.walmsley@sifive.com, palmer@dabbelt.com, aou@eecs.berkeley.edu, frank.binns@imgtec.com, matt.coster@imgtec.com, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, simona@ffwll.ch, ulf.hansson@linaro.org, jszhang@kernel.org, m.szyprowski@samsung.com Cc: linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, dri-devel@lists.freedesktop.org, linux-pm@vger.kernel.org, Michal Wilczynski Subject: [RFC PATCH v1 12/14] riscv: dts: Add Video Output clock and syscon regmap nodes Date: Tue, 3 Dec 2024 14:41:35 +0100 Message-Id: <20241203134137.2114847-13-m.wilczynski@samsung.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241203134137.2114847-1-m.wilczynski@samsung.com> Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA02SfUxTVxjGd+69vfe2Ce7SEjniDJMFdYvCxlx2NhcncdMb/AM/FtyYRptx VxlQWGun4jbEYqWsMN0gmy1IHfIZKhNaQiuMAE0B0c6VTxXQZjipLRK+JGjEUS5u/vc7z/O8 5zlvc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9NL6UzPNP4g3XnngtKax6PNM3Syxoglbw+Zs3cfIdfbI48iTG1J+K0svT/ZP 7fD2cZI9c+aw+4+WZ/ls1hMUJktMdHvN/7vDwMfs4I+CS8s6wmoW964y/Vq7dEfA/qi1W6VX rO6MZ71xq1Nt36z4pg2bnk5bdHjHj1S1vQqRrMck2s4bMXlNL30ttajrQsLEFb1sFw9yBrKd Nfp6a07k/ZlxRd1nrVqkcr69O/eqavPna7Ipj6Linmyf2bT2wD6JtdeWLy7XPfKqryi/UIml OCPRUIu5qDgRAK6j0Gq0AwAA X-CMS-MailID: 20241203134204eucas1p1d0df90a265637542f0652fd407dc7989 X-Msg-Generator: CA X-RootMTR: 20241203134204eucas1p1d0df90a265637542f0652fd407dc7989 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20241203134204eucas1p1d0df90a265637542f0652fd407dc7989 References: <20241203134137.2114847-1-m.wilczynski@samsung.com> The address space controlling the Video Output (VO) subsystem clocks also contains control registers for GPU resets. To properly synchronize access to this shared address space, create a syscon Device Tree node for the VO registers and reference it in the clock controller node. This change ensures coordinated access to the VO registers between the clock controller and other drivers, preventing conflicts and maintaining system stability. Signed-off-by: Michal Wilczynski --- arch/riscv/boot/dts/thead/th1520.dtsi | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/arch/riscv/boot/dts/thead/th1520.dtsi b/arch/riscv/boot/dts/thead/th1520.dtsi index dc2d554b4a71..39d39059160d 100644 --- a/arch/riscv/boot/dts/thead/th1520.dtsi +++ b/arch/riscv/boot/dts/thead/th1520.dtsi @@ -489,6 +489,18 @@ clk: clock-controller@ffef010000 { #clock-cells = <1>; }; + vosys_clk: clock-controller { + compatible = "thead,th1520-clk-vo"; + thead,vosys-regmap = <&vosys_reg>; + #clock-cells = <1>; + }; + + vosys_reg: vosys@ffef528000 { + compatible = "thead,th1520-vosys", "syscon"; + reg = <0xff 0xef528000 0x0 0x1000>; + status = "okay"; + }; + dmac0: dma-controller@ffefc00000 { compatible = "snps,axi-dma-1.01a"; reg = <0xff 0xefc00000 0x0 0x1000>; From patchwork Tue Dec 3 13:41:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Wilczynski X-Patchwork-Id: 847179 Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1C1FD1F666B for ; Tue, 3 Dec 2024 13:42:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.118.77.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733233331; cv=none; b=MD11kHqiGJjddY8dQsL6wAAhBbhb0AtxqqFjBqfDaWK/QL2ulu64E97Omd66mOgC7o9ewUCCafifSXTtwgGi197lyVNLTat6nW+3ZaPef/W+9yI/39d6MpiDyq7fx30BZjfh6f5naeEkMbV/rqfxReg/giDYfeNQbRf1gLXhXfc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733233331; c=relaxed/simple; bh=8am2sNNGYymVLoCZUo4DyJ1RjPVHV0dlNov/PfNPXAQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:MIME-Version: Content-Type:References; b=uYludj5zAuIBR1GeeUnoC3ca4vuALaMwspJlFh2O/Xfc4OqAN8Mwk4y4+TP0D2WLQpEXzpfbzrACAr5xkmD+V6yUrAmxWPQP2ytUaSau+Pnf8srxeccigy3y1XUZf182v7hQfRk7TOPhI3vpLxRTWwa4YRkvO1w3MCdybZvapoA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com; spf=pass smtp.mailfrom=samsung.com; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b=buQaAvFV; arc=none smtp.client-ip=210.118.77.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=samsung.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="buQaAvFV" Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20241203134207euoutp01469bf8d67ee3dda8f324e038becc3dc6~NroclkIk_2494924949euoutp017 for ; Tue, 3 Dec 2024 13:42:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20241203134207euoutp01469bf8d67ee3dda8f324e038becc3dc6~NroclkIk_2494924949euoutp017 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1733233327; bh=ZqpyrIT86+Z8L3YqwKLe85srHGtjvwzJ0vOwcnFYImg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=buQaAvFVRA7WSxR8+9UA4nqe6ICxaPlEI7B7IHMTEbKf0AD4e52JDxyZInd6tXB0W 0aaTky6JVwQZd0LZIABsegi9WA1uVPWfSCuiHBCA9cmirTVBpNSBnLeLFYLHRpwYEz s9w/JDHWvqplqFB1gBEXwmzs6dt/Fno9t8TyVK48= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20241203134206eucas1p2a0fb21d525d99d2d325e76361f1aaf57~NrocJH4B91761117611eucas1p2Z; Tue, 3 Dec 2024 13:42:06 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id E8.61.20397.EAA0F476; Tue, 3 Dec 2024 13:42:06 +0000 (GMT) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20241203134206eucas1p10ca2d7bb12afbd082d5f8a9ad85f94bd~NroblO0rD3124331243eucas1p1M; Tue, 3 Dec 2024 13:42:06 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20241203134205eusmtrp19989158973803a352ab1e40187820453~NrobkLLd_0888908889eusmtrp1d; Tue, 3 Dec 2024 13:42:05 +0000 (GMT) X-AuditID: cbfec7f5-ed1d670000004fad-5b-674f0aae148c Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id F8.07.19654.DAA0F476; Tue, 3 Dec 2024 13:42:05 +0000 (GMT) Received: from AMDC4942.home (unknown [106.210.136.40]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20241203134204eusmtip28aa0d75a1ff497816e13d85995da3d09~NroaPqseC0866008660eusmtip2F; Tue, 3 Dec 2024 13:42:04 +0000 (GMT) From: Michal Wilczynski To: mturquette@baylibre.com, sboyd@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, drew@pdp7.com, guoren@kernel.org, wefu@redhat.com, jassisinghbrar@gmail.com, paul.walmsley@sifive.com, palmer@dabbelt.com, aou@eecs.berkeley.edu, frank.binns@imgtec.com, matt.coster@imgtec.com, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, simona@ffwll.ch, ulf.hansson@linaro.org, jszhang@kernel.org, m.szyprowski@samsung.com Cc: linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, dri-devel@lists.freedesktop.org, linux-pm@vger.kernel.org, Michal Wilczynski Subject: [RFC PATCH v1 13/14] riscv: dts: Introduce power domain node with simple-bus compatible Date: Tue, 3 Dec 2024 14:41:36 +0100 Message-Id: <20241203134137.2114847-14-m.wilczynski@samsung.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241203134137.2114847-1-m.wilczynski@samsung.com> Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA02Sa0xTZxjHfc85PefQrHhaEN+BTKzRXeLQFU3ebcIkcclJdBsSLxsfJnUc ixkU1oqDbYk6GANs2bR2aLlZ0nCLeKK9DBiXCQ3lImwoFDCALOJmlUm41GUqsJbDNr/9nuf5 P5f/m5fGZVfJUPqY+jinUStT5KSYcHT8/cvrV8QfqLZ1dwejzqEKDNmfmih0ubkPQ+XOPhEa v2nD0IB3mkRX7v1KofvNpwnkri6lUHYHTyKPaZxEM7pxEbrVWEKiOb0TIMdcDonqnGMU4r3l GDLP2AlkqW8EKDe/UoT6u99Fnls6HOWaVqOlpnoKLbqvEqj4USuFbFNnRchVdwjltJ4ndoWz 08PfUOyUx0Ow7XnzFNv8+BLBNpjGKFbXcAOw12rzSXbU3USyZV372DtnXBhrtZxkc+o6MHa6 ZZBkC221gL2ZPUSx1p4v46QJ4p1JXMqxE5xma0yiONltKsTT51/I/L1Mcgr0iwtAAA2Z7dDx 2CUqAGJaxlQDyLvshBDMA3jasQSEYA7AudJZX4VeblkqDRTyVQB29HZSQjDl62gfwfxzSUYB J6rKl+cGMw9xOOwdIf0BzvwBoGOyhPSrgpgjkNePLjPBbILV1oZlljC74KzLhQkXroet13tx Pwf48g+NBSJBI4VdFycJP+M+Tba9GPcvgEydGJY1nwdC827Y26MnBQ6CD1w2SuB1sMegIwRO gxP2WVzgr2CDzrXCb8PRviek3zPOvAr5xq1COha2DUzgwlMEwuE/pcIJgfCco2glLYF5uTJB vRkadfr/lvZVO1ZcsdCwmA++BxtMz5kxPWfG9P/eSwCvBWu5DG2qitNGqbnPI7XKVG2GWhX5 SVrqNeD71T2LLm89qH4wE9kGMBq0AUjj8mBJFb9HJZMkKbO+4DRphzUZKZy2DYTRhHytZFPS ek7GqJTHuU85Lp3T/FvF6IDQU1hJf3TNYFbYlvu/SV8xh9mjVe/9+FFI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ZjP7fsYFz56qPeIUYmDsZDjBIczEoivMvXe6cL8aYkVlalFuXHF5XmpBYfYjQF unsis5Rocj4wqeWVxBuaGZgamphZGphamhkrifOyXTmfJiSQnliSmp2aWpBaBNPHxMEp1cBU vD+7do6LvtfUbxtmzCx57tVYPVdLy+8gz/JiZ0HDtZPLbkfVJV9IeZHRH9AuHRI5Sfe+Z+zC +wucGdI7sv4Et8ve9d3xX25C6qOLUQ++fLvxcqrqpdD9E9ZunB0QO6ma9+GGVxWW/qf9Xkb7 SQq6z/zNYP/ZO9muOOjG8iU/1a6mKrsZ2krYPLMSDKi6vD4nun7Nw3yDwjmnGcq52YW21Xec Dlus/cDIc5a58Sfj9k9CEQy23JGGjmt+Hi1S+yX66Pnj2xKmJ4qnHG4zzGXTdn1uohVybnZq 1a3FrT6ndracu7tue4GLfNLvC3daReLln3NcO9Tx8I3R5zVli7c8e7wxabZIV6Cf7vWFVkxK LMUZiYZazEXFiQCORnAisgMAAA== X-CMS-MailID: 20241203134206eucas1p10ca2d7bb12afbd082d5f8a9ad85f94bd X-Msg-Generator: CA X-RootMTR: 20241203134206eucas1p10ca2d7bb12afbd082d5f8a9ad85f94bd X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20241203134206eucas1p10ca2d7bb12afbd082d5f8a9ad85f94bd References: <20241203134137.2114847-1-m.wilczynski@samsung.com> The DRM Imagination GPU requires a power-domain driver, but the driver for "thead,th1520-aon" is not yet available. To ensure that the 'aon' node and its child 'pd' node are properly recognized and probed by the kernel, add "simple-bus" to the compatible property of the 'aon' node. This change allows the kernel to treat the 'aon' node as a simple bus, enabling the child nodes to be probed and initialized independently. It ensures that the power domain can be managed appropriately until the specific AON driver is developed. This commit introduces some errors while running dtbs_check, as the aon doesn't have the dt-bindings yet. Signed-off-by: Michal Wilczynski --- arch/riscv/boot/dts/thead/th1520.dtsi | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/arch/riscv/boot/dts/thead/th1520.dtsi b/arch/riscv/boot/dts/thead/th1520.dtsi index 39d39059160d..58f93ad3eb6e 100644 --- a/arch/riscv/boot/dts/thead/th1520.dtsi +++ b/arch/riscv/boot/dts/thead/th1520.dtsi @@ -6,6 +6,7 @@ #include #include +#include / { compatible = "thead,th1520"; @@ -229,6 +230,16 @@ stmmac_axi_config: stmmac-axi-config { snps,blen = <0 0 64 32 0 0 0>; }; + aon { + compatible = "thead,th1520-aon", "simple-bus"; + + pd: power-domain { + compatible = "thead,th1520-pd"; + thead,vosys-regmap = <&vosys_reg>; + #power-domain-cells = <1>; + }; + }; + soc { compatible = "simple-bus"; interrupt-parent = <&plic>; From patchwork Tue Dec 3 13:41:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Wilczynski X-Patchwork-Id: 847527 Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D82F31F130C for ; Tue, 3 Dec 2024 13:42:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.118.77.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733233333; cv=none; b=awZVGk4H7arzq+CscjxqtYHZlxD3n8g10MmPb4DY8VuRQUkyje/F9qmF2Rlq7WwTyURHdN+Ohnh/05VkhsW/JSuuhcET13uii32ibQhveWWZkvkS/ULH8fDz2ukiDXYf3O0xzQkNNovOSpSS2+OwXZinT275/YpK0uvTfD4UTUY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733233333; c=relaxed/simple; bh=Q09K24s6mZGeMftMhbsRCZSwqpl712NwsEN3b5mMKQs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:MIME-Version: Content-Type:References; b=kzyM3mZXPn5vyhT41wQQTJ9FHCc4OoC0z/RK1MqZqgeLq3XxvL9Gwz63bBbU03f3MjFATy97eMfAtDWUMP5i5mqdu8CjyZP5HmCiRJM1V5kiPCLFI3ojW9EKR3hs4PiLXqnJZrBlfHhshzKdrjVO3jzNhWt7EK5sKqjEObL+Hqc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com; spf=pass smtp.mailfrom=samsung.com; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b=LzKmSEpZ; arc=none smtp.client-ip=210.118.77.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=samsung.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="LzKmSEpZ" Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20241203134208euoutp0165b6437d16e42615cd1897f28b9d92a8~NrodvNB5H2577425774euoutp01P for ; Tue, 3 Dec 2024 13:42:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20241203134208euoutp0165b6437d16e42615cd1897f28b9d92a8~NrodvNB5H2577425774euoutp01P DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1733233328; bh=asLRQbzZayMb9yjHqxeg3uy1MkPJO2HP86mTn2EInqs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LzKmSEpZlf1ut93GLgZgZkL5DvwA9/s4Z4tXQvpfizc1ptHHgyzvlvncYlfq23/kH koSmiIRIpYqjRAwjaBCHioczuiP5BFvOXVnOeS6DKnKMjxEEZZQlXAbLP71fAOB5w5 2dIsgkMX7v142vE668YZEtP1iuEE35338SBxkwes= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20241203134207eucas1p2192873d281269b06d9a62beceeba8f3d~NrodRG3hq2525825258eucas1p2T; Tue, 3 Dec 2024 13:42:07 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id EA.61.20397.FAA0F476; Tue, 3 Dec 2024 13:42:07 +0000 (GMT) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20241203134207eucas1p29a2d095c527858729ae706d2a9027a5c~NrocvXTNQ0681706817eucas1p27; Tue, 3 Dec 2024 13:42:07 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20241203134207eusmtrp1bbfbc45095ec0d11460c41a654f8dea7~NrocuVBR50888908889eusmtrp1h; Tue, 3 Dec 2024 13:42:07 +0000 (GMT) X-AuditID: cbfec7f5-e59c770000004fad-5e-674f0aaf06f9 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id FA.07.19654.FAA0F476; Tue, 3 Dec 2024 13:42:07 +0000 (GMT) Received: from AMDC4942.home (unknown [106.210.136.40]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20241203134205eusmtip25691c9bf5366d4112ecb39c2227629f5~Nrobfx7Vv3160631606eusmtip2L; Tue, 3 Dec 2024 13:42:05 +0000 (GMT) From: Michal Wilczynski To: mturquette@baylibre.com, sboyd@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, drew@pdp7.com, guoren@kernel.org, wefu@redhat.com, jassisinghbrar@gmail.com, paul.walmsley@sifive.com, palmer@dabbelt.com, aou@eecs.berkeley.edu, frank.binns@imgtec.com, matt.coster@imgtec.com, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, simona@ffwll.ch, ulf.hansson@linaro.org, jszhang@kernel.org, m.szyprowski@samsung.com Cc: linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, dri-devel@lists.freedesktop.org, linux-pm@vger.kernel.org, Michal Wilczynski Subject: [RFC PATCH v1 14/14] riscv: dts: Add GPU node to TH1520 device tree Date: Tue, 3 Dec 2024 14:41:37 +0100 Message-Id: <20241203134137.2114847-15-m.wilczynski@samsung.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241203134137.2114847-1-m.wilczynski@samsung.com> Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA02Sf1CTdRzH7/s8z55nWzd6GJjfdMRBJ3cSoQjFlzSlu8qn1My6wyv/sBFP g+KHt4ml0AXxQwdT1MXQgfLzxkLmANnip+C2YyoG6nQCAZFJBix2gOwuMojxWPnf6/t+vz/3 +XFfPi5uJNfwk1IPsvJUaXIwKSTMPX/2v2wU7pZttLrC0NV7VRgy/aWlUH1nH4bKbX08NHq7 GUN35t0kujh+k0K/d2YTyKk/R6GcHiOJJrSjJJpRjfKQo62MRHPHbQCZ53JJZLCNUMg4X46h yhkTgWpa2gDKV+p46Nb1t9CEQ4WjfO2zaKmjhUKLzkYClU53UajZdYqH7Ia9KLfrOyI2gHEP 5FGMa2KCYKzHHlFMp6eCYFq1IxSjar0BmKY6JckMOztI5vy1PczPhXaMuVTzDZNr6MEY9+W7 JHOiuQ4wt3PuUcyl3oz3fT8Wbklgk5MOsfINWz8RJi643MSBxWe+0tU/BllgXlAABHxIR8Gs kiZQAIR8Ma0H8IZRQ3kNMf0IwG9toZwxB+BpXf6ywV+psDiiOb0WwJs9lST3cAHYPraEeatJ ehMcqy3neQ1/egqHA/ODKymcfgig+UEZ6U350TthSdEQ8DJBr4PnbIsrLKJj4W/TwzxuwEDY deVH3MuCZX2quIDHZXzhtbMPCC/jy5kcUynubQDp74Uwz9a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Kunb2aSk5mSW pRbp2yXoZfx6856l4B93xbI1fxgbGL9ydjFycEgImEgcumzexcjFISSwlFHix9Jeli5GTqC4 jMS17pdQtrDEn2tdbBBFrxglXp+cA5ZgEzCSeLB8PitIQkSgk0Xi7ea1jCAOs8BbRonrMzeC VQkL+EhM77/FCGKzCKhKzD3yD8zmFXCQePbuDivECnmJ/QfPMoPYnEDx11O7wOJCAvYSO/4e ZoWoF5Q4OfMJ2ExmoPrmrbOZJzAKzEKSmoUktYCRaRWjSGppcW56brGRXnFibnFpXrpecn7u JkZgWtl27OeWHYwrX33UO8TIxMF4iFGCg1lJhHf5eu90Id6UxMqq1KL8+KLSnNTiQ4ymQHdP ZJYSTc4HJra8knhDMwNTQxMzSwNTSzNjJXFetivn04QE0hNLUrNTUwtSi2D6mDg4pRqYNmlv imsyitncuSiw/uS3jUEn5/Wtli65ePHAZrdDclxBhg4Fc68G2Ehnvk7lYTQxnLk4ifn0iuMH bvHn5Zd/sv8XNV1fjFFqn9prPr5ZTDYTPF0W83/TtVNdkjmtQmHe5jkbsz81P87eOcPa3yT6 oM8Ocau+Yvc6G9am75ct5PN1Er4z6qRxnpo6ifv15FyTyA/7ijbqWUzo6TtYoXGQb5maxe4V mY415refeZ3bf10v9aZT0859Uttn7zRi3Ls08dprE+27nL//fPsS039LvS7lk2TiDnW9d9MP H536Sb1MSsvhhcf7GYesXKoV+Yu4DNokFqxIV1ZUapA50bArUfuM1uzD63Mrtl9zl+ZTYinO SDTUYi4qTgQACEKcjLQDAAA= X-CMS-MailID: 20241203134207eucas1p29a2d095c527858729ae706d2a9027a5c X-Msg-Generator: CA X-RootMTR: 20241203134207eucas1p29a2d095c527858729ae706d2a9027a5c X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20241203134207eucas1p29a2d095c527858729ae706d2a9027a5c References: <20241203134137.2114847-1-m.wilczynski@samsung.com> Add a device tree node for the IMG BXM-4-64 GPU present in the T-HEAD TH1520 SoC used by the Lichee Pi 4A board. This node enables support for the GPU using the drm/imagination driver. By adding this node, the kernel can recognize and initialize the GPU, providing graphics acceleration capabilities on the Lichee Pi 4A and other boards based on the TH1520 SoC. This commit is following convention introduced here [1]. Link: https://lore.kernel.org/all/20241118-sets-bxs-4-64-patch-v1-v2-1-3fd45d9fb0cf@imgtec.com/ [1] Signed-off-by: Michal Wilczynski --- arch/riscv/boot/dts/thead/th1520.dtsi | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/arch/riscv/boot/dts/thead/th1520.dtsi b/arch/riscv/boot/dts/thead/th1520.dtsi index 58f93ad3eb6e..5023c0c29168 100644 --- a/arch/riscv/boot/dts/thead/th1520.dtsi +++ b/arch/riscv/boot/dts/thead/th1520.dtsi @@ -500,6 +500,18 @@ clk: clock-controller@ffef010000 { #clock-cells = <1>; }; + gpu: gpu@ffef400000 { + compatible = "img,img-bxm-4-64", "img,img-rogue"; + reg = <0xff 0xef400000 0x0 0x100000>; + interrupt-parent = <&plic>; + interrupts = <102 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&vosys_clk CLK_GPU_CORE>, + <&vosys_clk CLK_GPU_CFG_ACLK>; + clock-names = "core", "sys"; + power-domains = <&pd TH1520_AON_GPU_PD>; + status = "okay"; + }; + vosys_clk: clock-controller { compatible = "thead,th1520-clk-vo"; thead,vosys-regmap = <&vosys_reg>;