Skip to contentSkip to conversation

sysreset: sophgo: milkv_duo: Add sysreset support for Milk-V Duo board

PATCH Superseded Kongyang Liu 2 participants 7 messages Apr 16, 2024 – May 1, 2024 Sophgo devicetrees and drivers

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover sysreset: sophgo: milkv_duo: Add sysreset support for Milk-V Duo board

This series add sysreset driver for cv1800b SoC and enable poweroff and reset commands for Sophgo Milk-V Duo board.

Kongyang Liu (3):
sysreset: cv1800b: Add sysreset driver for cv1800b SoC
board: sophgo: milkv_duo: Bind sysreset driver
configs: milkv_duo: Add sysreset configs

 board/sophgo/milkv_duo/board.c      |  4 ++
 configs/milkv_duo_defconfig         |  3 ++
 drivers/sysreset/Kconfig            |  5 +++
 drivers/sysreset/Makefile           |  1 +
 drivers/sysreset/sysreset_cv1800b.c | 64 +++++++++++++++++++++++++++++
 5 files changed, 77 insertions(+)
 create mode 100644 drivers/sysreset/sysreset_cv1800b.c
Signature · 1 line
2.41.0
#1 lore raw

PATCH 1/3 sysreset: cv1800b: Add sysreset driver for cv1800b SoC

Add sysreset driver for cv1800b SoC

---

 drivers/sysreset/Kconfig            |  5 +++
 drivers/sysreset/Makefile           |  1 +
 drivers/sysreset/sysreset_cv1800b.c | 64 +++++++++++++++++++++++++++++
 3 files changed, 70 insertions(+)
 create mode 100644 drivers/sysreset/sysreset_cv1800b.c
drivers/sysreset/Kconfig +5 -0
index 49c0787b26..b64bfadb20 100644
@@ -59,6 +59,11 @@ config SYSRESET_CMD_POWEROFF
 
 endif
 
+config SYSRESET_CV1800B
+	bool "Enable support for Sophgo cv1800b System Reset"
+	help
+	  Enable system reset support for Sophgo cv1800b SoC.
+
 config POWEROFF_GPIO
 	bool "Enable support for GPIO poweroff driver"
 	depends on DM_GPIO
drivers/sysreset/Makefile +1 -0
index e0e732205d..d59299aa31 100644
@@ -7,6 +7,7 @@ obj-$(CONFIG_ARCH_ASPEED) += sysreset_ast.o
 obj-$(CONFIG_ARCH_ROCKCHIP) += sysreset_rockchip.o
 obj-$(CONFIG_ARCH_STI) += sysreset_sti.o
 obj-$(CONFIG_SANDBOX) += sysreset_sandbox.o
+obj-$(CONFIG_SYSRESET_CV1800B) += sysreset_cv1800b.o
 obj-$(CONFIG_POWEROFF_GPIO) += poweroff_gpio.o
 obj-$(CONFIG_SYSRESET_GPIO) += sysreset_gpio.o
 obj-$(CONFIG_$(SPL_TPL_)SYSRESET_MAX77663) += sysreset_max77663.o
drivers/sysreset/sysreset_cv1800b.c new file +64 -0

64 lines not on this page · raw message

Signature · 1 line
2.41.0
Reviewed-by on v1 1/3
#2 lore raw

Re: [PATCH 1/3] sysreset: cv1800b: Add sysreset driver for cv1800b SoC

Quoted 10 lines · Kongyang Liu

Add sysreset driver for cv1800b SoC

---

 drivers/sysreset/Kconfig            |  5 +++
 drivers/sysreset/Makefile           |  1 +
 drivers/sysreset/sysreset_cv1800b.c | 64 +++++++++++++++++++++++++++++
 3 files changed, 70 insertions(+)
 create mode 100644 drivers/sysreset/sysreset_cv1800b.c
#3 lore raw

PATCH 2/3 board: sophgo: milkv_duo: Bind sysreset driver

In reply to Kongyang Liu

Bind cv1800b sysreset driver for Sophgo Milk-V Duo board in board_init function.

---

 board/sophgo/milkv_duo/board.c | 4 ++++
 1 file changed, 4 insertions(+)
board/sophgo/milkv_duo/board.c +4 -0
index eaa47be173..e7e28fe248 100644
@@ -3,7 +3,11 @@
  * Copyright (c) 2024, Kongyang Liu <[email protected]>
  */
 
+ #include <dm/lists.h>
+
 int board_init(void)
 {
+	if (IS_ENABLED(CONFIG_SYSRESET_CV1800B))
+		device_bind_driver(gd->dm_root, "cv1800b_sysreset", "sysreset", NULL);
 	return 0;
 }
Signature · 1 line
2.41.0
#5 lore raw

PATCH 3/3 configs: milkv_duo: Add sysreset configs

In reply to Kongyang Liu

Add sysreset configs as well as poweroff and reset commands for Sophgo Milk-V Duo board.

---

 configs/milkv_duo_defconfig | 3 +++
 1 file changed, 3 insertions(+)
configs/milkv_duo_defconfig +3 -0
index e8413d7aa9..28bd4b53d3 100644
@@ -19,6 +19,7 @@ CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="milkv_duo# "
 CONFIG_CMD_MMC=y
 CONFIG_CMD_PART=y
+CONFIG_CMD_POWEROFF=y
 CONFIG_CMD_FAT=y
 CONFIG_CMD_FS_GENERIC=y
 CONFIG_ENV_OVERWRITE=y
@@ -30,3 +31,5 @@ CONFIG_MMC_SDHCI_ADMA=y
 CONFIG_MMC_SDHCI_CV1800B=y
 CONFIG_SYS_NS16550=y
 CONFIG_SYS_NS16550_MEM32=y
+CONFIG_SYSRESET=y
+CONFIG_SYSRESET_CV1800B=y
Signature · 1 line
2.41.0