From: Krzysztof Kozlowski <krzk@kernel.org>
To: dang.huynh@mainlining.org,
Manivannan Sadhasivam <mani@kernel.org>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Linus Walleij <linus.walleij@linaro.org>,
Bartosz Golaszewski <brgl@bgdev.pl>,
Alexandre Belloni <alexandre.belloni@bootlin.com>,
Michael Turquette <mturquette@baylibre.com>,
Stephen Boyd <sboyd@kernel.org>,
Philipp Zabel <p.zabel@pengutronix.de>,
Sebastian Reichel <sre@kernel.org>, Vinod Koul <vkoul@kernel.org>,
Kees Cook <kees@kernel.org>,
"Gustavo A. R. Silva" <gustavoars@kernel.org>,
Ulf Hansson <ulf.hansson@linaro.org>
Cc: linux-arm-kernel@lists.infradead.org,
linux-unisoc@lists.infradead.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org,
linux-rtc@vger.kernel.org, linux-clk@vger.kernel.org,
linux-pm@vger.kernel.org, dmaengine@vger.kernel.org,
linux-hardening@vger.kernel.org, linux-mmc@vger.kernel.org
Subject: Re: [PATCH 15/25] power: reset: Add basic power reset driver for RDA8810PL
Date: Wed, 17 Sep 2025 09:45:19 +0900 [thread overview]
Message-ID: <8e2a796d-0c7e-44de-990b-572479bf1e89@kernel.org> (raw)
In-Reply-To: <20250917-rda8810pl-drivers-v1-15-9ca9184ca977@mainlining.org>
On 17/09/2025 22:25, Dang Huynh via B4 Relay wrote:
> From: Dang Huynh <dang.huynh@mainlining.org>
>
> This basic driver can only reboot, powering off requires the modem
> firmware which we don't have yet.
>
> Signed-off-by: Dang Huynh <dang.huynh@mainlining.org>
> ---
> MAINTAINERS | 6 +++++
> drivers/power/reset/Kconfig | 9 +++++++
> drivers/power/reset/Makefile | 1 +
> drivers/power/reset/rda-reboot.c | 58 ++++++++++++++++++++++++++++++++++++++++
> 4 files changed, 74 insertions(+)
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index cbe2ab8af6dcd40dd1456d9df55673dace3c87b2..5ec24d8657bffb55c160947a930980e428c6a6b7 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -21399,6 +21399,12 @@ S: Maintained
> F: Documentation/devicetree/bindings/clock/rda,8810pl-apsyscon.yaml
> F: drivers/clk/rda/clk-rda8810.c
>
> +RDA MICRO MODEM RESET DRIVER
> +M: Dang Huynh <dang.huynh@mainlining.org>
> +S: Maintained
> +F: Documentation/devicetree/bindings/power/reset/rda,md-reset.yaml
> +F: drivers/power/reset/rda-reboot.c
> +
> RDA MICRO REAL TIME CLOCK DRIVER
> M: Dang Huynh <dang.huynh@mainlining.org>
> S: Maintained
> diff --git a/drivers/power/reset/Kconfig b/drivers/power/reset/Kconfig
> index 77ea3129c70806929f3c248667db42f05f5f1d27..de9b1afb94d14a5d23286ddb302af4107d649c12 100644
> --- a/drivers/power/reset/Kconfig
> +++ b/drivers/power/reset/Kconfig
> @@ -205,6 +205,15 @@ config POWER_RESET_QNAP
>
> Say Y if you have a QNAP NAS.
>
> +config POWER_RESET_RDA
> + bool "RDA Micro Reset Driver"
> + depends on ARCH_RDA
|| COMPILE_TEST
everywhere, for all your drivers.
> + help
> + This driver supports soft resetting RDA Micro boards by writing
> + magic values to the modem register.
> +
> + Say Y if you have a board with RDA Micro SoC.
> +
> config POWER_RESET_REGULATOR
> bool "Regulator subsystem power-off driver"
> depends on OF && REGULATOR
> diff --git a/drivers/power/reset/Makefile b/drivers/power/reset/Makefile
> index b7c2b5940be9971548a5527384d1931abff11c4c..14371230410dad2852489160f4fc23d8fd087d6e 100644
> --- a/drivers/power/reset/Makefile
> +++ b/drivers/power/reset/Makefile
> @@ -22,6 +22,7 @@ obj-$(CONFIG_POWER_RESET_ODROID_GO_ULTRA_POWEROFF) += odroid-go-ultra-poweroff.o
> obj-$(CONFIG_POWER_RESET_PIIX4_POWEROFF) += piix4-poweroff.o
> obj-$(CONFIG_POWER_RESET_LTC2952) += ltc2952-poweroff.o
> obj-$(CONFIG_POWER_RESET_QNAP) += qnap-poweroff.o
> +obj-$(CONFIG_POWER_RESET_RDA) += rda-reboot.o
> obj-$(CONFIG_POWER_RESET_REGULATOR) += regulator-poweroff.o
> obj-$(CONFIG_POWER_RESET_RESTART) += restart-poweroff.o
> obj-$(CONFIG_POWER_RESET_ST) += st-poweroff.o
> diff --git a/drivers/power/reset/rda-reboot.c b/drivers/power/reset/rda-reboot.c
> new file mode 100644
> index 0000000000000000000000000000000000000000..d87b063ba67d847f8e869e50a6c01427b2866889
> --- /dev/null
> +++ b/drivers/power/reset/rda-reboot.c
> @@ -0,0 +1,58 @@
> +// SPDX-License-Identifier: GPL-2.0-only
> +/*
> + * Copyright (c) 2025, Dang Huynh <dang.huynh@mainlining.org>
> + *
> + * Based on drivers/power/reset/msm-poweroff.c:
> + * Copyright (c) 2013, The Linux Foundation. All rights reserved.
> + */
> +
> +#include <linux/err.h>
> +#include <linux/init.h>
> +#include <linux/kernel.h>
> +#include <linux/io.h>
> +#include <linux/of.h>
> +#include <linux/platform_device.h>
> +#include <linux/module.h>
> +#include <linux/reboot.h>
> +#include <linux/pm.h>
> +#include <linux/mfd/syscon.h>
> +
> +static void __iomem *rda_md_sysctrl;
No, no singletons.
> +
> +static int do_rda_reboot(struct sys_off_data *data)
> +{
> + /* unprotect md registers */
> + writel(0x00A50001, rda_md_sysctrl);
> +
> + /* reset all */
> + writel(0x80000000, rda_md_sysctrl + 4);
> +
> + return NOTIFY_DONE;
> +}
> +
> +static int rda_reboot_probe(struct platform_device *pdev)
> +{
> + rda_md_sysctrl = devm_platform_ioremap_resource(pdev, 0);
> + if (IS_ERR(rda_md_sysctrl))
> + return PTR_ERR(rda_md_sysctrl);
> +
> + devm_register_sys_off_handler(&pdev->dev, SYS_OFF_MODE_RESTART,
> + 128, do_rda_reboot, NULL);
> +
> + return 0;
> +}
> +
> +static const struct of_device_id of_rda_reboot_match[] = {
> + { .compatible = "rda,md-reset", },
> + {},
> +};
> +MODULE_DEVICE_TABLE(of, of_rda_reboot_match);
> +
> +static struct platform_driver rda_reboot_driver = {
> + .probe = rda_reboot_probe,
> + .driver = {
> + .name = "rda-reboot",
> + .of_match_table = of_match_ptr(of_rda_reboot_match),
Drop of_match_ptr, you have warnings here.
> + },
> +};
> +builtin_platform_driver(rda_reboot_driver);
>
Best regards,
Krzysztof
next prev parent reply other threads:[~2025-09-17 0:45 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-16 20:24 [PATCH 00/25] RDA8810PL Clock, RTC and MMC driver Dang Huynh via B4 Relay
2025-09-16 20:24 ` [PATCH 01/25] ARM: dts: unisoc: rda8810pl: Add label to GPIO nodes Dang Huynh via B4 Relay
2025-09-17 0:39 ` Krzysztof Kozlowski
2025-09-16 20:24 ` [PATCH 02/25] drivers: gpio: rda: Make IRQ optional Dang Huynh via B4 Relay
2025-09-16 20:25 ` [PATCH 03/25] dt-bindings: gpio: rda: Make interrupts optional Dang Huynh via B4 Relay
2025-09-16 20:25 ` [PATCH 04/25] rtc: Add timestamp for the end of 2127 Dang Huynh via B4 Relay
2025-09-16 20:25 ` [PATCH 05/25] dt-bindings: rtc: Add RDA Micro RDA8810PL RTC Dang Huynh via B4 Relay
2025-09-16 20:25 ` [PATCH 06/25] rtc: Add driver for RDA Micro SoC Dang Huynh via B4 Relay
2025-09-19 13:59 ` kernel test robot
2025-11-06 22:42 ` Alexandre Belloni
2025-09-16 20:25 ` [PATCH 07/25] ARM: dts: unisoc: rda8810pl: Enable Real-Time Clock Dang Huynh via B4 Relay
2025-09-17 0:40 ` Krzysztof Kozlowski
2025-09-16 20:25 ` [PATCH 08/25] ARM: dts: unisoc: rda8810pl: Enable ARM PMU Dang Huynh via B4 Relay
2025-09-16 20:25 ` [PATCH 09/25] dt-bindings: clock: Add RDA Micro RDA8810PL clock/reset controller Dang Huynh via B4 Relay
2025-09-17 0:43 ` Krzysztof Kozlowski
2025-09-16 20:25 ` [PATCH 10/25] drivers: clk: Add Clock and Reset Driver for RDA Micro RDA8810PL SoC Dang Huynh via B4 Relay
2025-09-20 4:50 ` Stephen Boyd
2025-09-16 20:25 ` [PATCH 11/25] dts: unisoc: rda8810pl: Enable clock/reset driver Dang Huynh via B4 Relay
2025-09-17 0:41 ` Krzysztof Kozlowski
2025-09-16 20:25 ` [PATCH 12/25] dts: unisoc: rda8810pl: Add OPP for CPU and define L2 cache Dang Huynh via B4 Relay
2025-09-16 20:25 ` [PATCH 13/25] dts: unisoc: orangepi: Disable UART with no users Dang Huynh via B4 Relay
2025-09-16 20:25 ` [PATCH 14/25] dt-bindings: power: reset: Add RDA Micro Modem Reset Dang Huynh via B4 Relay
2025-09-17 0:44 ` Krzysztof Kozlowski
2025-09-16 20:25 ` [PATCH 15/25] power: reset: Add basic power reset driver for RDA8810PL Dang Huynh via B4 Relay
2025-09-17 0:45 ` Krzysztof Kozlowski [this message]
2025-09-16 20:25 ` [PATCH 16/25] dts: unisoc: rda8810pl: Enable modem reset Dang Huynh via B4 Relay
2025-09-17 0:46 ` Krzysztof Kozlowski
2025-09-16 20:25 ` [PATCH 17/25] drivers: gpio: rda: Make direction register unreadable Dang Huynh via B4 Relay
2025-09-17 8:00 ` Bartosz Golaszewski
2025-09-16 20:25 ` [PATCH 18/25] dt-bindings: dma: Add RDA IFC DMA Dang Huynh via B4 Relay
2025-09-16 20:25 ` [PATCH 19/25] dmaengine: Add RDA IFC driver Dang Huynh via B4 Relay
2025-09-16 20:25 ` [PATCH 20/25] dts: unisoc: rda8810pl: Enable IFC Dang Huynh via B4 Relay
2025-09-16 20:25 ` [PATCH 21/25] dt-bindings: mmc: Add RDA SDMMC controller Dang Huynh via B4 Relay
2025-09-17 0:00 ` Krzysztof Kozlowski
2025-09-16 20:25 ` [PATCH 22/25] mmc: host: Add RDA Micro SD/MMC driver Dang Huynh via B4 Relay
2025-09-17 0:48 ` Krzysztof Kozlowski
2025-09-16 20:25 ` [PATCH 23/25] dts: unisoc: rda8810pl: Add SDMMC controllers Dang Huynh via B4 Relay
2025-09-16 20:25 ` [PATCH 24/25] dts: unisoc: orangepi-2g: Enable SD Card Dang Huynh via B4 Relay
2025-09-16 20:25 ` [PATCH 25/25] dts: unisoc: orangepi-i96: " Dang Huynh via B4 Relay
2025-09-17 10:03 ` [PATCH 00/25] RDA8810PL Clock, RTC and MMC driver Manivannan Sadhasivam
2025-09-18 5:02 ` Dang Huynh
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8e2a796d-0c7e-44de-990b-572479bf1e89@kernel.org \
--to=krzk@kernel.org \
--cc=alexandre.belloni@bootlin.com \
--cc=brgl@bgdev.pl \
--cc=conor+dt@kernel.org \
--cc=dang.huynh@mainlining.org \
--cc=devicetree@vger.kernel.org \
--cc=dmaengine@vger.kernel.org \
--cc=gustavoars@kernel.org \
--cc=kees@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-rtc@vger.kernel.org \
--cc=linux-unisoc@lists.infradead.org \
--cc=mani@kernel.org \
--cc=mturquette@baylibre.com \
--cc=p.zabel@pengutronix.de \
--cc=robh@kernel.org \
--cc=sboyd@kernel.org \
--cc=sre@kernel.org \
--cc=ulf.hansson@linaro.org \
--cc=vkoul@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).