riscv: rtc: sophgo: add rtc support for CV1800
Subsystems (5)
v12 cover riscv: rtc: sophgo: add rtc support for CV1800
Real Time Clock (RTC) is an independently powered module within the chip, which includes a 32KHz oscillator and a Power On Reset/POR submodule. It can be used for time display and timed alarm generation.
This series aims to provide complete DT bindings, but the drivers are only focusing on RTC implementation. Possible Power Management and remoteproc can be implemented later (hence the RTC driver is using syscon, because MMIO space is really interleaved among different functions).
Series is tested on Milk-V Duo Module 01 EVB (SG2000 SoC).
Changes since v11:
- dropped restart handling (will be implemented in PSCI)
- split RTC driver into MFD stub and a platform RTC driver
- dropped Reviewed-by: Krzysztof Kozlowski from bindings, they've got a rework
- changed bindings maintainer from Jingbao Qiu <[email protected]> to [email protected]
- added link to TRM into bindings description
- bindings: mentioned 8051 core in the description
- bindings are now MFD, not RTC
- bindings: added "syscon" compatible
- bindings: added "interrupt-names", "clock-names" (because of added PM/remoteproc)
- bindings: main compatible "sophgo,cv1800-rtc" -> "sophgo,cv1800b-rtc"
- new patch "mfd: sophgo: cv1800: rtcsys: New driver (handling RTC only)"
- added both MFD and RTC drivers into MAINTAINERS file (N: K: entries didn't apply)
- RTC: depends on cv1800-rtcsys MFD driver
- RTC: use syscon for regmap
- RTC: get named clock from parent MFD
Changes since v10:
- only start RTC on set_time;
Changes since v9:
- further simplified bitmask macros;
- unconditional RTC start (rtc_enable_sec_counter()), otherwise didn't start on SG2000;
- dropped ANA_CALIB modification (has been forgotten in v8 with the drop of SW calibration to switch to HW calibration);
- successfully tested on SG2000;
Changes since v10:
- only start RTC on set_time;
- add machine restart handler (as separate patch 3/3);
Changes since v9:
- picked up orphaned series;
- further simplified bitmask macros;
- unconditional RTC start (rtc_enable_sec_counter());
- dropped ANA_CALIB modification;
- successfully tested on SG2000;
v9: https://lore.kernel.org/linux-riscv/[email protected]/
Changes since v8:
- delete unused macros
- using 0/1 instead of the DISABLE/ENABLE macro
- pass in the correct pointer when applying for IRQ
- convert the incoming pointer into an appropriate structure pointer in the irq handler
v8: https://lore.kernel.org/all/[email protected]/
Changes since v7:
- pass checkpatch.pl --strict
- using u32 replace uint32
- using devm_kzalloc(*) replace devm_kzalloc(sizeof())
- sort header files alphabetically
- delete unnecessary header files
- fix wrap error
- drop dependent description
- using hardware automatic calibration replace software calibration. see documentation 197 page
v7: https://lore.kernel.org/all/[email protected]/
documentation: https://github.com/milkv-duo/duo-files/blob/main/duo/datasheet/CV1800B-CV1801B-Preliminary-Datasheet-full-en.pdf
Changes since v6:
- completely delete POR dt node
- remove syscon tag
- use devm_regmap_init_mmio() replace
syscon_node_to_regmap
v6: https://lore.kernel.org/all/[email protected]/
Changes since v5:
- remove unnecessary lock
- fix cv1800_rtc_alarm_irq_enable()
- remove duplicate checks
- using alrm->enabled instead of unconditionally
enabling
- remove disable alarms on probe
- using rtc_update_irq() replace mess of alarm
- remove leak clk
- useing devm_rtc_allocate_device() and
devm_rtc_register_device() instead old way
- add judgment for rtc_enable_sec_counter()
- add POR nodes in DTS. This POR device shares
the register region with the RTC device
v5: https://lore.kernel.org/all/[email protected]/
Changes since v4:
- remove POR dt-bindings because it empty
- remove MFD dt-bindings because SoC does
not have MFDs
- add syscon attribute to share registers
with POR
v4: https://lore.kernel.org/all/[email protected]/
Changes since v3:
- temporarily not submitting RTC driver code
waiting for communication with IC designer
- add MFD dt-bindings
- add POR dt-bindings
v3: https://lore.kernel.org/all/[email protected]/
Changes since v2:
- add mfd support for CV1800
- add rtc to mfd
- using regmap replace iomap
- merge register address in dts
v2: https://lore.kernel.org/lkml/[email protected]/
Changes since v1
- fix duplicate names in subject
- using RTC replace RTC controller
- improve the properties of dt-bindings
- using unevaluatedProperties replace additionalProperties
- dt-bindings passed the test
- using devm_platform_ioremap_resource() replace platform_get_resource() and devm_ioremap_resource()
- fix random order of the code
- fix wrong wrapping of the devm_request_irq() and map the flag with dts
- using devm_clk_get_enabled replace devm_clk_get() and clk_prepare_enable()
- fix return style
- add rtc clock calibration function
- use spinlock when write register on read/set time
v1: https://lore.kernel.org/lkml/[email protected]/
Alexander Sverdlin (1):
mfd: sophgo: cv1800: rtcsys: New driver (handling RTC only)
Jingbao Qiu (2):
dt-bindings: mfd: sophgo: add RTC support for Sophgo CV1800 series SoC
rtc: sophgo: add rtc support for Sophgo CV1800 SoC
.../bindings/mfd/sophgo,cv1800b-rtc.yaml | 86 +++++++ MAINTAINERS | 2 + drivers/mfd/Kconfig | 14 ++ drivers/mfd/Makefile | 1 + drivers/mfd/cv1800-rtcsys.c | 66 ++++++ drivers/rtc/Kconfig | 12 + drivers/rtc/Makefile | 1 + drivers/rtc/rtc-cv1800.c | 218 ++++++++++++++++++ 8 files changed, 400 insertions(+) create mode 100644 Documentation/devicetree/bindings/mfd/sophgo,cv1800b-rtc.yaml create mode 100644 drivers/mfd/cv1800-rtcsys.c create mode 100644 drivers/rtc/rtc-cv1800.c
Signature · 1 line
2.48.1
PATCH v12 1/3 dt-bindings: mfd: sophgo: add RTC support for Sophgo CV1800 series SoC
From: Jingbao Qiu <[email protected]>
Add RTC devicetree binding for Sophgo CV1800 series SoC. The device is called RTC, but contains control registers of other HW blocks in its address space, most notably of Power-on-Reset (PoR) module, DW8051 IP (MCU core), accompanying SRAM, hence putting it in MFD subsystem.
---
Changelog:
v12:
- maintainer Jingbao Qiu <[email protected]> -> [email protected]
- dropped Reviewed-by: Krzysztof Kozlowski
- link to TRM
- mentioned 8051 core in the description
- binding is now MFD, not RTC
- added "syscon" compatible
- added "interrupt-names", "clock-names" (because of added PM/remoteproc)
- main compatible "sophgo,cv1800-rtc" -> "sophgo,cv1800b-rtc"
.../bindings/mfd/sophgo,cv1800b-rtc.yaml | 86 +++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 Documentation/devicetree/bindings/mfd/sophgo,cv1800b-rtc.yaml
Documentation/devicetree/bindings/mfd/sophgo,cv1800b-rtc.yaml new file +86 -0
@@ -0,0 +1,86 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/mfd/sophgo,cv1800b-rtc.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Real Time Clock of the Sophgo CV1800 SoC + +description: + The RTC (Real Time Clock) is an independently powered module in the chip. It + contains a 32KHz oscillator and a Power-On-Reset (POR) sub-module, which can + be used for time display and scheduled alarm produce. In addition, the + hardware state machine provides triggering and timing control for chip + power-on, power-off and reset. + + Furthermore, the 8051 subsystem is located within RTCSYS and is independently + powered. System software can use the 8051 to manage wake conditions and wake + the system while the system is asleep, and communicate with external devices + through peripheral controllers. + + Technical Reference Manual available at + https://github.com/sophgo/sophgo-doc/tree/main/SG200X/TRM + +maintainers: + - [email protected] + +allOf: + - $ref: /schemas/rtc/rtc.yaml# + +properties: + compatible: + items: + - const: sophgo,cv1800b-rtc + - const: syscon + + reg: + maxItems: 1 + + interrupts: + items: + - description: RTC Alarm + - description: RTC Longpress + - description: VBAT DET + + interrupt-names: + items: + - const: alarm + - const: longpress + - const: vbat + + clocks: + items: + - description: RTC clock source + - description: DW8051 MCU clock source + + clock-names: + items: + - const: rtc + - const: mcu + +required: + - compatible + - reg + - interrupts + - interrupt-names + - clocks + - clock-names + +unevaluatedProperties: false + +examples: + - | + #include <dt-bindings/clock/sophgo,cv1800.h> + #include <dt-bindings/interrupt-controller/irq.h> + + rtc@5025000 { + compatible = "sophgo,cv1800b-rtc", "syscon"; + reg = <0x5025000 0x2000>; + interrupts = <17 IRQ_TYPE_LEVEL_HIGH>, + <18 IRQ_TYPE_LEVEL_HIGH>, + <19 IRQ_TYPE_LEVEL_HIGH>; + interrupt-names = "alarm", "longpress", "vbat"; + clocks = <&clk CLK_RTC_25M>, + <&clk CLK_SRC_RTC_SYS_0>; + clock-names = "rtc", "mcu"; + };
Signature · 1 line
2.48.1
Re: [PATCH v12 1/3] dt-bindings: mfd: sophgo: add RTC support for Sophgo CV1800 series SoC
Quoted 6 lines · Alexander Sverdlin
From: Jingbao Qiu <[email protected]>
Add RTC devicetree binding for Sophgo CV1800 series SoC. The device is called RTC, but contains control registers of other HW blocks in its address space, most notably of Power-on-Reset (PoR) module, DW8051 IP (MCU core), accompanying SRAM, hence putting it in MFD subsystem.
Assuming this is integrated block in the CV1800 SoC, then this should go to soc/ and probably called system controller or similarly.
How is it called in the datasheet?
Quoted 49 lines
Signed-off-by Jingbao Qiu <[email protected]>Signed-off-by Alexander Sverdlin <[email protected]>---
Changelog:
v12:
- maintainer Jingbao Qiu <[email protected]> -> [email protected]
- dropped Reviewed-by: Krzysztof Kozlowski
- link to TRM
- mentioned 8051 core in the description
- binding is now MFD, not RTC
- added "syscon" compatible
- added "interrupt-names", "clock-names" (because of added PM/remoteproc)
- main compatible "sophgo,cv1800-rtc" -> "sophgo,cv1800b-rtc".../bindings/mfd/sophgo,cv1800b-rtc.yaml | 86 +++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 Documentation/devicetree/bindings/mfd/sophgo,cv1800b-rtc.yamlDocumentation/devicetree/bindings/mfd/sophgo,cv1800b-rtc.yaml new file +24
-0@@ -0,0 +1,86 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/mfd/sophgo,cv1800b-rtc.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Real Time Clock of the Sophgo CV1800 SoC + +description: + The RTC (Real Time Clock) is an independently powered module in the chip. It + contains a 32KHz oscillator and a Power-On-Reset (POR) sub-module, which can + be used for time display and scheduled alarm produce. In addition, the + hardware state machine provides triggering and timing control for chip + power-on, power-off and reset. + + Furthermore, the 8051 subsystem is located within RTCSYS and is independently + powered. System software can use the 8051 to manage wake conditions and wake + the system while the system is asleep, and communicate with external devices + through peripheral controllers. + + Technical Reference Manual available at + https://github.com/sophgo/sophgo-doc/tree/main/SG200X/TRM + +maintainers:
Documentation/devicetree/bindings/mfd/sophgo,cv1800b-rtc.yaml line 34
Quoted 10 lines
Documentation/devicetree/bindings/mfd/sophgo,cv1800b-rtc.yaml new file +10
-0+ - [email protected] + +allOf: + - $ref: /schemas/rtc/rtc.yaml# + +properties: + compatible: + items: + - const: sophgo,cv1800b-rtc + - const: syscon
Binding is fine, but still open topics are: placement and compatible name.
Best regards,
Krzysztof
PATCH v12 2/3 mfd: sophgo: cv1800: rtcsys: New driver (handling RTC only)
In reply to Alexander SverdlinAdd driver for Sophgo CV1800 series SoC RTC MFD. The RTC module comprises a 32kHz oscillator, Power-on-Reset (PoR) sub-module, HW state machine to control chip power-on, power-off and reset. Furthermore, the 8051 subsystem is located within RTCSYS including associated SRAM block.
This patch only populates RTC sub-device.
---
Changelog:
v12:
- new patch
MAINTAINERS | 1 + drivers/mfd/Kconfig | 14 ++++++++ drivers/mfd/Makefile | 1 + drivers/mfd/cv1800-rtcsys.c | 66 +++++++++++++++++++++++++++++++++++++ 4 files changed, 82 insertions(+) create mode 100644 drivers/mfd/cv1800-rtcsys.c
MAINTAINERS +1 -0
@@ -22185,6 +22185,7 @@ M: Chen Wang <[email protected]> M: Inochi Amaoto <[email protected]> T: git https://github.com/sophgo/linux.git S: Maintained +F: drivers/mfd/cv1800-rtcsys.c N: sophgo K: sophgo
drivers/mfd/Kconfig +14 -0
@@ -285,6 +285,20 @@ config MFD_CS42L43_SDW Select this to support the Cirrus Logic CS42L43 PC CODEC with headphone and class D speaker drivers over SoundWire. +config MFD_CV1800_RTCSYS + tristate "Sophgo CV1800 RTC MFD" + depends on ARCH_SOPHGO || COMPILE_TEST + select MFD_CORE + help + If you say yes here you get support the RTC MFD driver for Sophgo + CV1800 series SoC. The RTC module comprises a 32kHz oscillator, + Power-on-Reset (PoR) sub-module, HW state machine to control chip + power-on, power-off and reset. Furthermore, the 8051 subsystem is + located within RTCSYS including associated SRAM block. + + This driver can also be built as a module. If so, the module will be + called cv1800-rtcsys. + config MFD_MADERA tristate "Cirrus Logic Madera codecs" select MFD_CORE
drivers/mfd/Makefile +1 -0
@@ -18,6 +18,7 @@ obj-$(CONFIG_MFD_CROS_EC_DEV) += cros_ec_dev.o obj-$(CONFIG_MFD_CS42L43) += cs42l43.o obj-$(CONFIG_MFD_CS42L43_I2C) += cs42l43-i2c.o obj-$(CONFIG_MFD_CS42L43_SDW) += cs42l43-sdw.o +obj-$(CONFIG_MFD_CV1800_RTCSYS) += cv1800-rtcsys.o obj-$(CONFIG_MFD_ENE_KB3930) += ene-kb3930.o obj-$(CONFIG_MFD_EXYNOS_LPASS) += exynos-lpass.o obj-$(CONFIG_MFD_GATEWORKS_GSC) += gateworks-gsc.o
drivers/mfd/cv1800-rtcsys.c new file +66 -0
66 lines not on this page · raw message
Signature · 1 line
2.48.1
kernel test robot
build botRe: [PATCH v12 2/3] mfd: sophgo: cv1800: rtcsys: New driver (handling RTC only)
kernel test robot noticed the following build warnings:
Hi Alexander,
kernel test robot noticed the following build warnings:
[auto build test WARNING on lee-mfd/for-mfd-next]
[also build test WARNING on abelloni/rtc-next linus/master lee-mfd/for-mfd-fixes v6.14-rc5 next-20250305] [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/Alexander-Sverdlin/dt-bindings-mfd-sophgo-add-RTC-support-for-Sophgo-CV1800-series-SoC/20250303-035433 base: https://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git for-mfd-next patch link: https://lore.kernel.org/r/20250302195205.3183174-3-alexander.sverdlin%40gmail.com patch subject: [PATCH v12 2/3] mfd: sophgo: cv1800: rtcsys: New driver (handling RTC only) config: hexagon-allyesconfig (https://download.01.org/0day-ci/archive/20250306/[email protected]/config) compiler: clang version 18.1.8 (https://github.com/llvm/llvm-project 3b5b5c1ec4a3095ab096dd780e84d7ab81f3d7ff) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250306/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All warnings (new ones prefixed by >>):
>> drivers/mfd/cv1800-rtcsys.c:30:30: warning: unused variable 'cv1800_rtcsys_rtc_subdev' [-Wunused-const-variable]
30 | static const struct mfd_cell cv1800_rtcsys_rtc_subdev =
| ^~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
vim +/cv1800_rtcsys_rtc_subdev +30 drivers/mfd/cv1800-rtcsys.c
29
> 30 static const struct mfd_cell cv1800_rtcsys_rtc_subdev =
31 MFD_CELL_NAME("cv1800-rtc");
32 Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
Lee Jones
maintainerRe: [PATCH v12 2/3] mfd: sophgo: cv1800: rtcsys: New driver (handling RTC only)
In reply to Alexander SverdlinQuoted 96 lines · Alexander Sverdlin
Add driver for Sophgo CV1800 series SoC RTC MFD. The RTC module comprises a 32kHz oscillator, Power-on-Reset (PoR) sub-module, HW state machine to control chip power-on, power-off and reset. Furthermore, the 8051 subsystem is located within RTCSYS including associated SRAM block.
This patch only populates RTC sub-device.
Signed-off-by Alexander Sverdlin <[email protected]>---
Changelog:
v12:
- new patchMAINTAINERS | 1 + drivers/mfd/Kconfig | 14 ++++++++ drivers/mfd/Makefile | 1 + drivers/mfd/cv1800-rtcsys.c | 66 +++++++++++++++++++++++++++++++++++++ 4 files changed, 82 insertions(+) create mode 100644 drivers/mfd/cv1800-rtcsys.cMAINTAINERS +1
-0@@ -22185,6 +22185,7 @@ M: Chen Wang <[email protected]> M: Inochi Amaoto <[email protected]> T: git https://github.com/sophgo/linux.git S: Maintained +F: drivers/mfd/cv1800-rtcsys.c N: sophgo K: sophgodrivers/mfd/Kconfig +14
-0@@ -285,6 +285,20 @@ config MFD_CS42L43_SDW Select this to support the Cirrus Logic CS42L43 PC CODEC with headphone and class D speaker drivers over SoundWire. +config MFD_CV1800_RTCSYS + tristate "Sophgo CV1800 RTC MFD" + depends on ARCH_SOPHGO || COMPILE_TEST + select MFD_CORE + help + If you say yes here you get support the RTC MFD driver for Sophgo + CV1800 series SoC. The RTC module comprises a 32kHz oscillator, + Power-on-Reset (PoR) sub-module, HW state machine to control chip + power-on, power-off and reset. Furthermore, the 8051 subsystem is + located within RTCSYS including associated SRAM block. + + This driver can also be built as a module. If so, the module will be + called cv1800-rtcsys. + config MFD_MADERA tristate "Cirrus Logic Madera codecs" select MFD_COREdrivers/mfd/Makefile +1
-0@@ -18,6 +18,7 @@ obj-$(CONFIG_MFD_CROS_EC_DEV) += cros_ec_dev.o obj-$(CONFIG_MFD_CS42L43) += cs42l43.o obj-$(CONFIG_MFD_CS42L43_I2C) += cs42l43-i2c.o obj-$(CONFIG_MFD_CS42L43_SDW) += cs42l43-sdw.o +obj-$(CONFIG_MFD_CV1800_RTCSYS) += cv1800-rtcsys.o obj-$(CONFIG_MFD_ENE_KB3930) += ene-kb3930.o obj-$(CONFIG_MFD_EXYNOS_LPASS) += exynos-lpass.o obj-$(CONFIG_MFD_GATEWORKS_GSC) += gateworks-gsc.odrivers/mfd/cv1800-rtcsys.c new file +21
-0@@ -0,0 +1,66 @@ +// SPDX-License-Identifier: GPL-2.0 +/* +* Driver for Sophgo CV1800 series SoC RTC MFD +* +* The RTC module comprises a 32kHz oscillator, Power-on-Reset (PoR) sub-module, +* HW state machine to control chip power-on, power-off and reset. Furthermore, +* the 8051 subsystem is located within RTCSYS including associated SRAM block. +* +* Copyright (C) 2025 Alexander Sverdlin <[email protected]> +* +*/ + +#include <linux/mfd/core.h> +#include <linux/module.h> +#include <linux/of.h> +#include <linux/property.h> + +static struct resource cv1800_rtcsys_irq_resources[] = { +DEFINE_RES_IRQ_NAMED (0 ,"alarm" ), +}; +
drivers/mfd/cv1800-rtcsys.c line 31
Quoted 10 lines
drivers/mfd/cv1800-rtcsys.c new file +10
-0+static const struct mfd_cell cv1800_rtcsys_subdev[] = { + { + .name ="cv1800-rtc" , + .num_resources =1 , + .resources = &cv1800_rtcsys_irq_resources[0 ], + }, +}; + +static const struct mfd_cell cv1800_rtcsys_rtc_subdev = +MFD_CELL_NAME ("cv1800-rtc" );
How is this different from the one above?
Adding a single device does not constitute an MFD.
Quoted 37 lines
drivers/mfd/cv1800-rtcsys.c new file +34
-0+static int cv1800_rtcsys_probe (struct platform_device *pdev) +{ +int irq; + + irq =platform_get_irq_byname (pdev,"alarm" ); +if (irq <0 ) +return irq; + cv1800_rtcsys_irq_resources[0 ].start = irq; + cv1800_rtcsys_irq_resources[0 ].end = irq; + +return devm_mfd_add_devices (&pdev->dev,PLATFORM_DEVID_AUTO , + cv1800_rtcsys_subdev, +ARRAY_SIZE (cv1800_rtcsys_subdev), +NULL ,0 ,NULL ); +} + +static const struct of_device_id cv1800_rtcsys_of_match[] = { + { .compatible ="sophgo,cv1800b-rtc" }, + {/* sentinel */ } +}; +MODULE_DEVICE_TABLE (of, cv1800_rtcsys_of_match); + +static struct platform_driver cv1800_rtcsys_mfd = { + .probe = cv1800_rtcsys_probe, + .driver = { + .name ="cv1800_rtcsys" , + .of_match_table = cv1800_rtcsys_of_match, + }, +}; +module_platform_driver (cv1800_rtcsys_mfd); + +MODULE_AUTHOR ("Alexander Sverdlin <[email protected]>" ); +MODULE_DESCRIPTION ("Sophgo CV1800 series SoC RTC MFD driver" ); +MODULE_LICENSE ("GPL" );Signature · 1 line
2.48.1
Signature · 1 line
Lee Jones [李琼斯]
kernel test robot
build botRe: [PATCH v12 2/3] mfd: sophgo: cv1800: rtcsys: New driver (handling RTC only)
In reply to Alexander Sverdlinkernel test robot noticed the following build warnings:
Hi Alexander,
kernel test robot noticed the following build warnings:
[auto build test WARNING on lee-mfd/for-mfd-next]
[also build test WARNING on abelloni/rtc-next linus/master lee-mfd/for-mfd-fixes v6.14-rc5 next-20250305] [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/Alexander-Sverdlin/dt-bindings-mfd-sophgo-add-RTC-support-for-Sophgo-CV1800-series-SoC/20250303-035433 base: https://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git for-mfd-next patch link: https://lore.kernel.org/r/20250302195205.3183174-3-alexander.sverdlin%40gmail.com patch subject: [PATCH v12 2/3] mfd: sophgo: cv1800: rtcsys: New driver (handling RTC only) config: sh-allyesconfig (https://download.01.org/0day-ci/archive/20250306/[email protected]/config) compiler: sh4-linux-gcc (GCC) 14.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250306/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All warnings (new ones prefixed by >>):
>> drivers/mfd/cv1800-rtcsys.c:30:30: warning: 'cv1800_rtcsys_rtc_subdev' defined but not used [-Wunused-const-variable=]
30 | static const struct mfd_cell cv1800_rtcsys_rtc_subdev =
| ^~~~~~~~~~~~~~~~~~~~~~~~
vim +/cv1800_rtcsys_rtc_subdev +30 drivers/mfd/cv1800-rtcsys.c
29
> 30 static const struct mfd_cell cv1800_rtcsys_rtc_subdev =
31 MFD_CELL_NAME("cv1800-rtc");
32 Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
PATCH v12 3/3 rtc: sophgo: add rtc support for Sophgo CV1800 SoC
In reply to Alexander SverdlinFrom: Jingbao Qiu <[email protected]>
Implement the RTC driver for CV1800, which able to provide time alarm.
---
v12:
- added MAINTAINERS entry
- depends on cv1800-rtcsys MFD driver
- use syscon for regmap
- get named clock from parent MFD
- corresponding platform device is expected to be instantiated by MFD stub Changes since v10:
- only start RTC on set_time;
Changes since v9:
- further simplified bitmask macros;
- unconditional RTC start (rtc_enable_sec_counter()), otherwise didn't start on SG2000;
- dropped ANA_CALIB modification (has been forgotten in v8 with the drop of SW calibration to switch to HW calibration);
- successfully tested on SG2000;
MAINTAINERS | 1 + drivers/rtc/Kconfig | 12 +++ drivers/rtc/Makefile | 1 + drivers/rtc/rtc-cv1800.c | 218 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 232 insertions(+) create mode 100644 drivers/rtc/rtc-cv1800.c
MAINTAINERS +1 -0
@@ -22186,6 +22186,7 @@ M: Inochi Amaoto <[email protected]> T: git https://github.com/sophgo/linux.git S: Maintained F: drivers/mfd/cv1800-rtcsys.c +F: drivers/rtc/rtc-cv1800.c N: sophgo K: sophgo
drivers/rtc/Kconfig +12 -0
@@ -1395,6 +1395,18 @@ config RTC_DRV_ASM9260 This driver can also be built as a module. If so, the module will be called rtc-asm9260. +config RTC_DRV_CV1800 + tristate "Sophgo CV1800 RTC" + depends on MFD_CV1800_RTCSYS || COMPILE_TEST + select MFD_SYSCON + select REGMAP + help + If you say yes here you get support the RTC driver for Sophgo CV1800 + series SoC. + + This driver can also be built as a module. If so, the module will be + called rtc-cv1800. + config RTC_DRV_DIGICOLOR tristate "Conexant Digicolor RTC" depends on ARCH_DIGICOLOR || COMPILE_TEST
drivers/rtc/Makefile +1 -0
@@ -44,6 +44,7 @@ obj-$(CONFIG_RTC_DRV_CADENCE) += rtc-cadence.o obj-$(CONFIG_RTC_DRV_CMOS) += rtc-cmos.o obj-$(CONFIG_RTC_DRV_CPCAP) += rtc-cpcap.o obj-$(CONFIG_RTC_DRV_CROS_EC) += rtc-cros-ec.o +obj-$(CONFIG_RTC_DRV_CV1800) += rtc-cv1800.o obj-$(CONFIG_RTC_DRV_DA9052) += rtc-da9052.o obj-$(CONFIG_RTC_DRV_DA9055) += rtc-da9055.o obj-$(CONFIG_RTC_DRV_DA9063) += rtc-da9063.o
drivers/rtc/rtc-cv1800.c new file +218 -0
218 lines not on this page · raw message
Signature · 1 line
2.48.1