Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/2] Add infra_ao reset support for MT8188 Soc
@ 2023-05-24 13:34 Runyang Chen
  2023-05-24 13:34 ` [PATCH v3 1/2] dt-bindings: reset: mt8188: add thermal reset control bit Runyang Chen
  2023-05-24 13:34 ` [PATCH v3 2/2] clk: mediatek: reset: add infra_ao reset support for MT8188 Runyang Chen
  0 siblings, 2 replies; 5+ messages in thread
From: Runyang Chen @ 2023-05-24 13:34 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Matthias Brugger,
	AngeloGioacchino Del Regno, Philipp Zabel, Rob Herring,
	Krzysztof Kozlowski
  Cc: linux-clk, linux-kernel, linux-arm-kernel, linux-mediatek,
	devicetree, Runyang Chen

Based on tag: next-20230524, linux-next/master

v3:
1. The infra_ao_rst_ofs, infra_ao_idx_map and infra_ao_rst_desc are not
modified by the driver, so constify them.

v2:
1. Modify SoB to match author name.

v1:
1. Add thermal reset bit for MT8188.
2. Add infra_ao reset support for MT8188.

Runyang Chen (2):
  dt-bindings: reset: mt8188: add thermal reset control bit
  clk: mediatek: reset: add infra_ao reset support for MT8188

 drivers/clk/mediatek/clk-mt8188-infra_ao.c | 24 ++++++++++++++++++++++
 include/dt-bindings/reset/mt8188-resets.h  |  5 +++++
 2 files changed, 29 insertions(+)

--
2.18.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v3 1/2] dt-bindings: reset: mt8188: add thermal reset control bit
  2023-05-24 13:34 [PATCH v3 0/2] Add infra_ao reset support for MT8188 Soc Runyang Chen
@ 2023-05-24 13:34 ` Runyang Chen
  2023-05-24 21:10   ` Conor Dooley
  2023-05-24 13:34 ` [PATCH v3 2/2] clk: mediatek: reset: add infra_ao reset support for MT8188 Runyang Chen
  1 sibling, 1 reply; 5+ messages in thread
From: Runyang Chen @ 2023-05-24 13:34 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Matthias Brugger,
	AngeloGioacchino Del Regno, Philipp Zabel, Rob Herring,
	Krzysztof Kozlowski
  Cc: linux-clk, linux-kernel, linux-arm-kernel, linux-mediatek,
	devicetree, Runyang Chen

To support reset of infra_ao, add the index of infra_ao reset of thermal
for MT8188.

Signed-off-by: Runyang Chen <runyang.chen@mediatek.com>
---
 include/dt-bindings/reset/mt8188-resets.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/include/dt-bindings/reset/mt8188-resets.h b/include/dt-bindings/reset/mt8188-resets.h
index 377cdfda82a9..ba9a5e9b8899 100644
--- a/include/dt-bindings/reset/mt8188-resets.h
+++ b/include/dt-bindings/reset/mt8188-resets.h
@@ -33,4 +33,9 @@
 
 #define MT8188_TOPRGU_SW_RST_NUM               24
 
+/* INFRA resets */
+#define MT8188_INFRA_RST1_THERMAL_MCU_RST          0
+#define MT8188_INFRA_RST1_THERMAL_CTRL_RST         1
+#define MT8188_INFRA_RST3_PTP_CTRL_RST             2
+
 #endif  /* _DT_BINDINGS_RESET_CONTROLLER_MT8188 */
-- 
2.18.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v3 2/2] clk: mediatek: reset: add infra_ao reset support for MT8188
  2023-05-24 13:34 [PATCH v3 0/2] Add infra_ao reset support for MT8188 Soc Runyang Chen
  2023-05-24 13:34 ` [PATCH v3 1/2] dt-bindings: reset: mt8188: add thermal reset control bit Runyang Chen
@ 2023-05-24 13:34 ` Runyang Chen
  2023-05-25  1:23   ` kernel test robot
  1 sibling, 1 reply; 5+ messages in thread
From: Runyang Chen @ 2023-05-24 13:34 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Matthias Brugger,
	AngeloGioacchino Del Regno, Philipp Zabel, Rob Herring,
	Krzysztof Kozlowski
  Cc: linux-clk, linux-kernel, linux-arm-kernel, linux-mediatek,
	devicetree, Runyang Chen

The infra_ao reset is needed for MT8188.
- Add mtk_clk_rst_desc for MT8188.
- Add register reset controller function for MT8188 infra_ao.
- Add infra_ao_idx_map for MT8188.

Signed-off-by: Runyang Chen <runyang.chen@mediatek.com>
---
 drivers/clk/mediatek/clk-mt8188-infra_ao.c | 24 ++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/drivers/clk/mediatek/clk-mt8188-infra_ao.c b/drivers/clk/mediatek/clk-mt8188-infra_ao.c
index a38ddc7b6a88..bb53e92144c2 100644
--- a/drivers/clk/mediatek/clk-mt8188-infra_ao.c
+++ b/drivers/clk/mediatek/clk-mt8188-infra_ao.c
@@ -5,6 +5,7 @@
  */
 
 #include <dt-bindings/clock/mediatek,mt8188-clk.h>
+#include <dt-bindings/reset/mt8188-resets.h>
 #include <linux/clk-provider.h>
 #include <linux/platform_device.h>
 
@@ -176,9 +177,32 @@ static const struct mtk_gate infra_ao_clks[] = {
 		       "infra_ao_aes_msdcfde_0p", "top_aes_msdcfde", 18),
 };
 
+static const u16 infra_ao_rst_ofs[] = {
+	INFRA_RST0_SET_OFFSET,
+	INFRA_RST1_SET_OFFSET,
+	INFRA_RST2_SET_OFFSET,
+	INFRA_RST3_SET_OFFSET,
+	INFRA_RST4_SET_OFFSET,
+};
+
+static const u16 infra_ao_idx_map[] = {
+	[MT8188_INFRA_RST1_THERMAL_MCU_RST] = 1 * RST_NR_PER_BANK + 2,
+	[MT8188_INFRA_RST1_THERMAL_CTRL_RST] = 1 * RST_NR_PER_BANK + 4,
+	[MT8188_INFRA_RST3_PTP_CTRL_RST] = 3 * RST_NR_PER_BANK + 5,
+};
+
+static const struct mtk_clk_rst_desc infra_ao_rst_desc = {
+	.version = MTK_RST_SET_CLR,
+	.rst_bank_ofs = infra_ao_rst_ofs,
+	.rst_bank_nr = ARRAY_SIZE(infra_ao_rst_ofs),
+	.rst_idx_map = infra_ao_idx_map,
+	.rst_idx_map_nr = ARRAY_SIZE(infra_ao_idx_map),
+};
+
 static const struct mtk_clk_desc infra_ao_desc = {
 	.clks = infra_ao_clks,
 	.num_clks = ARRAY_SIZE(infra_ao_clks),
+	.rst_desc = &infra_ao_rst_desc,
 };
 
 static const struct of_device_id of_match_clk_mt8188_infra_ao[] = {
-- 
2.18.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v3 1/2] dt-bindings: reset: mt8188: add thermal reset control bit
  2023-05-24 13:34 ` [PATCH v3 1/2] dt-bindings: reset: mt8188: add thermal reset control bit Runyang Chen
@ 2023-05-24 21:10   ` Conor Dooley
  0 siblings, 0 replies; 5+ messages in thread
From: Conor Dooley @ 2023-05-24 21:10 UTC (permalink / raw)
  To: Runyang Chen
  Cc: Michael Turquette, Stephen Boyd, Matthias Brugger,
	AngeloGioacchino Del Regno, Philipp Zabel, Rob Herring,
	Krzysztof Kozlowski, linux-clk, linux-kernel, linux-arm-kernel,
	linux-mediatek, devicetree


[-- Attachment #1.1: Type: text/plain, Size: 291 bytes --]

On Wed, May 24, 2023 at 09:34:38PM +0800, Runyang Chen wrote:
> To support reset of infra_ao, add the index of infra_ao reset of thermal
> for MT8188.
> 
> Signed-off-by: Runyang Chen <runyang.chen@mediatek.com>

Acked-by: Conor Dooley <conor.dooley@microchip.com>

Thanks,
Conor.

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v3 2/2] clk: mediatek: reset: add infra_ao reset support for MT8188
  2023-05-24 13:34 ` [PATCH v3 2/2] clk: mediatek: reset: add infra_ao reset support for MT8188 Runyang Chen
@ 2023-05-25  1:23   ` kernel test robot
  0 siblings, 0 replies; 5+ messages in thread
From: kernel test robot @ 2023-05-25  1:23 UTC (permalink / raw)
  To: Runyang Chen, Michael Turquette, Stephen Boyd, Matthias Brugger,
	AngeloGioacchino Del Regno, Philipp Zabel, Rob Herring,
	Krzysztof Kozlowski
  Cc: llvm, oe-kbuild-all, linux-clk, linux-kernel, linux-arm-kernel,
	linux-mediatek, devicetree, Runyang Chen

Hi Runyang,

kernel test robot noticed the following build errors:

[auto build test ERROR on clk/clk-next]
[also build test ERROR on pza/reset/next]
[cannot apply to pza/imx-drm/next mbgg-mediatek/for-next]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Runyang-Chen/dt-bindings-reset-mt8188-add-thermal-reset-control-bit/20230524-213538
base:   https://git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git clk-next
patch link:    https://lore.kernel.org/r/20230524133439.20659-3-runyang.chen%40mediatek.com
patch subject: [PATCH v3 2/2] clk: mediatek: reset: add infra_ao reset support for MT8188
config: riscv-randconfig-r042-20230524 (https://download.01.org/0day-ci/archive/20230525/202305250908.Uvas9u4E-lkp@intel.com/config)
compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project 4faf3aaf28226a4e950c103a14f6fc1d1fdabb1b)
reproduce (this is a W=1 build):
        mkdir -p ~/bin
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install riscv cross compiling tool for clang build
        # apt-get install binutils-riscv64-linux-gnu
        # https://github.com/intel-lab-lkp/linux/commit/7d969d160489d561f9b1fb6388adaa1ba8fe06a1
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Runyang-Chen/dt-bindings-reset-mt8188-add-thermal-reset-control-bit/20230524-213538
        git checkout 7d969d160489d561f9b1fb6388adaa1ba8fe06a1
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang ~/bin/make.cross W=1 O=build_dir ARCH=riscv olddefconfig
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang ~/bin/make.cross W=1 O=build_dir ARCH=riscv SHELL=/bin/bash drivers/clk/mediatek/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202305250908.Uvas9u4E-lkp@intel.com/

All errors (new ones prefixed by >>):

>> drivers/clk/mediatek/clk-mt8188-infra_ao.c:196:18: error: initializing 'u16 *' (aka 'unsigned short *') with an expression of type 'const u16[5]' (aka 'const unsigned short[5]') discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
           .rst_bank_ofs = infra_ao_rst_ofs,
                           ^~~~~~~~~~~~~~~~
   drivers/clk/mediatek/clk-mt8188-infra_ao.c:198:17: error: initializing 'u16 *' (aka 'unsigned short *') with an expression of type 'const u16[3]' (aka 'const unsigned short[3]') discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
           .rst_idx_map = infra_ao_idx_map,
                          ^~~~~~~~~~~~~~~~
   2 errors generated.


vim +196 drivers/clk/mediatek/clk-mt8188-infra_ao.c

   193	
   194	static const struct mtk_clk_rst_desc infra_ao_rst_desc = {
   195		.version = MTK_RST_SET_CLR,
 > 196		.rst_bank_ofs = infra_ao_rst_ofs,
   197		.rst_bank_nr = ARRAY_SIZE(infra_ao_rst_ofs),
   198		.rst_idx_map = infra_ao_idx_map,
   199		.rst_idx_map_nr = ARRAY_SIZE(infra_ao_idx_map),
   200	};
   201	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-05-25  1:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-24 13:34 [PATCH v3 0/2] Add infra_ao reset support for MT8188 Soc Runyang Chen
2023-05-24 13:34 ` [PATCH v3 1/2] dt-bindings: reset: mt8188: add thermal reset control bit Runyang Chen
2023-05-24 21:10   ` Conor Dooley
2023-05-24 13:34 ` [PATCH v3 2/2] clk: mediatek: reset: add infra_ao reset support for MT8188 Runyang Chen
2023-05-25  1:23   ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox