devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: muhammed.efecetin.67@gmail.com
To: linux-rockchip@lists.infradead.org
Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, robh+dt@kernel.org,
	krzysztof.kozlowski+dt@linaro.org, heiko@sntech.de,
	neil.armstrong@linaro.org, lee@kernel.org, rafael@kernel.org,
	efectn@protonmail.com, daniel.lezcano@linaro.org
Subject: [PATCH 3/5] mfd: khadas-mcu: add Khadas Edge 2 registers
Date: Thu, 26 Jun 2025 17:04:30 +0300	[thread overview]
Message-ID: <16807e13e034f85adc91d131f6c5046ce7d98d9c.1746518265.git.efectn@protonmail.com> (raw)
In-Reply-To: <cover.1746518265.git.efectn@protonmail.com>

From: Muhammed Efe Cetin <efectn@protonmail.com>

Add Khadas Edge 2 MCU registers to khadas-mcu.h and adjust some properties.
Also, i've added some registers with V2 suffix,
as same addresses were already exist for previous boards.

Signed-off-by: Muhammed Efe Cetin <efectn@protonmail.com>
---
 drivers/mfd/khadas-mcu.c       |  8 ++++++--
 include/linux/mfd/khadas-mcu.h | 25 +++++++++++++++++++++++++
 2 files changed, 31 insertions(+), 2 deletions(-)

diff --git a/drivers/mfd/khadas-mcu.c b/drivers/mfd/khadas-mcu.c
index ca4bd6cf5..199ed4925 100644
--- a/drivers/mfd/khadas-mcu.c
+++ b/drivers/mfd/khadas-mcu.c
@@ -26,6 +26,10 @@ static bool khadas_mcu_reg_volatile(struct device *dev, unsigned int reg)
 	case KHADAS_MCU_CHECK_USER_PASSWD_REG:
 	case KHADAS_MCU_WOL_INIT_START_REG:
 	case KHADAS_MCU_CMD_FAN_STATUS_CTRL_REG:
+	case KHADAS_MCU_LED_ON_RAM_REG:
+	case KHADAS_MCU_CMD_FAN_STATUS_CTRL_REG_V2:
+	case KHADAS_MCU_WDT_EN_REG:
+	case KHADAS_MCU_SYS_RST_REG:
 		return true;
 	default:
 		return false;
@@ -69,14 +73,14 @@ static const struct regmap_config khadas_mcu_regmap_config = {
 	.reg_bits	= 8,
 	.reg_stride	= 1,
 	.val_bits	= 8,
-	.max_register	= KHADAS_MCU_CMD_FAN_STATUS_CTRL_REG,
+	.max_register	= KHADAS_MCU_SYS_RST_REG,
 	.volatile_reg	= khadas_mcu_reg_volatile,
 	.writeable_reg	= khadas_mcu_reg_writeable,
 	.cache_type	= REGCACHE_MAPLE,
 };
 
 static struct mfd_cell khadas_mcu_fan_cells[] = {
-	/* VIM1/2 Rev13+ and VIM3 only */
+	/* VIM1/2 Rev13+, VIM3 and Edge2 only */
 	{ .name = "khadas-mcu-fan-ctrl", },
 };
 
diff --git a/include/linux/mfd/khadas-mcu.h b/include/linux/mfd/khadas-mcu.h
index a99ba2ed0..de570e159 100644
--- a/include/linux/mfd/khadas-mcu.h
+++ b/include/linux/mfd/khadas-mcu.h
@@ -35,26 +35,45 @@
 #define KHADAS_MCU_FACTORY_TEST_REG		0x16 /* R */
 #define KHADAS_MCU_BOOT_MODE_REG		0x20 /* RW */
 #define KHADAS_MCU_BOOT_EN_WOL_REG		0x21 /* RW */
+#define KHADAS_MCU_BOOT_EN_DCIN_REG_V2		0x21 /* RW */
 #define KHADAS_MCU_BOOT_EN_RTC_REG		0x22 /* RW */
 #define KHADAS_MCU_BOOT_EN_EXP_REG		0x23 /* RW */
+#define KHADAS_MCU_LED_MODE_ON_REG_V2		0x23 /* RW */
+#define KHADAS_MCU_LED_MODE_OFF_REG_V2		0x24 /* RW */
 #define KHADAS_MCU_BOOT_EN_IR_REG		0x24 /* RW */
 #define KHADAS_MCU_BOOT_EN_DCIN_REG		0x25 /* RW */
+#define KHADAS_MCU_RGB_ON_R_REG			0x25 /* RW */
+#define KHADAS_MCU_RGB_ON_G_REG			0x26 /* RW */
 #define KHADAS_MCU_BOOT_EN_KEY_REG		0x26 /* RW */
+#define KHADAS_MCU_RGB_ON_B_REG			0x27 /* RW */
 #define KHADAS_MCU_KEY_MODE_REG			0x27 /* RW */
+#define KHADAS_MCU_RGB_OFF_R_REG		0x28 /* RW */
 #define KHADAS_MCU_LED_MODE_ON_REG		0x28 /* RW */
+#define KHADAS_MCU_RGB_OFF_G_REG		0x29 /* RW */
 #define KHADAS_MCU_LED_MODE_OFF_REG		0x29 /* RW */
+#define KHADAS_MCU_RGB_OFF_B_REG		0x2a /* RW */
+#define KHADAS_MCU_REST_CONF_REG		0x2c /* WO */
 #define KHADAS_MCU_SHUTDOWN_NORMAL_REG		0x2c /* RW */
 #define KHADAS_MCU_MAC_SWITCH_REG		0x2d /* RW */
 #define KHADAS_MCU_MCU_SLEEP_MODE_REG		0x2e /* RW */
+#define KHADAS_MCU_BOOT_EN_IR_REG_V2		0x2f /* RW */
 #define KHADAS_MCU_IR_CODE1_0_REG		0x2f /* RW */
 #define KHADAS_MCU_IR_CODE1_1_REG		0x30 /* RW */
+#define KHADAS_MCU_IR1_CUST1_REG		0x30 /* RW */
 #define KHADAS_MCU_IR_CODE1_2_REG		0x31 /* RW */
+#define KHADAS_MCU_IR1_CUST2_REG		0x31 /* RW */
 #define KHADAS_MCU_IR_CODE1_3_REG		0x32 /* RW */
+#define KHADAS_MCU_IR1_ORDER1_REG		0x32 /* RW */
 #define KHADAS_MCU_USB_PCIE_SWITCH_REG		0x33 /* RW */
+#define KHADAS_MCU_IR1_ORDER2_REG		0x33 /* RW */
+#define KHADAS_MCU_IR2_CUST1_REG		0x34 /* RW */
 #define KHADAS_MCU_IR_CODE2_0_REG		0x34 /* RW */
 #define KHADAS_MCU_IR_CODE2_1_REG		0x35 /* RW */
+#define KHADAS_MCU_IR2_CUST2_REG		0x35 /* RW */
 #define KHADAS_MCU_IR_CODE2_2_REG		0x36 /* RW */
+#define KHADAS_MCU_IR2_ORDER1_REG		0x36 /* RW */
 #define KHADAS_MCU_IR_CODE2_3_REG		0x37 /* RW */
+#define KHADAS_MCU_IR2_ORDER2_REG		0x36 /* RW */
 #define KHADAS_MCU_PASSWD_USER_0_REG		0x40 /* RW */
 #define KHADAS_MCU_PASSWD_USER_1_REG		0x41 /* RW */
 #define KHADAS_MCU_PASSWD_USER_2_REG		0x42 /* RW */
@@ -69,6 +88,11 @@
 #define KHADAS_MCU_SHUTDOWN_NORMAL_STATUS_REG	0x86 /* RO */
 #define KHADAS_MCU_WOL_INIT_START_REG		0x87 /* WO */
 #define KHADAS_MCU_CMD_FAN_STATUS_CTRL_REG	0x88 /* WO */
+#define KHADAS_MCU_LED_ON_RAM_REG		0x89 /* WO */
+#define KHADAS_MCU_CMD_FAN_STATUS_CTRL_REG_V2	0x8A /* WO */
+#define KHADAS_MCU_WDT_EN_REG			0x8B /* WO */
+#define KHADAS_MCU_SYS_RST_REG			0x91 /* WO */
+
 
 enum {
 	KHADAS_BOARD_VIM1 = 0x1,
@@ -76,6 +100,7 @@ enum {
 	KHADAS_BOARD_VIM3,
 	KHADAS_BOARD_EDGE = 0x11,
 	KHADAS_BOARD_EDGE_V,
+	KHADAS_BOARD_EDGE2,
 };
 
 /**
-- 
2.49.0


  parent reply	other threads:[~2025-06-26 14:05 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-26 14:04 [PATCH 0/5] Add Khadas MCU and fan control support for Khadas Edge 2 muhammed.efecetin.67
2025-06-26 14:04 ` [PATCH 1/5] dt-bindings: mfd: khadas-mcu: add cooling-levels property muhammed.efecetin.67
2025-06-26 14:12   ` neil.armstrong
2025-06-26 14:04 ` [PATCH 2/5] mfd: khadas-mcu: drop unused nvmem code muhammed.efecetin.67
2025-06-26 14:07   ` neil.armstrong
2025-06-26 14:04 ` muhammed.efecetin.67 [this message]
2025-06-26 14:13   ` [PATCH 3/5] mfd: khadas-mcu: add Khadas Edge 2 registers neil.armstrong
2025-06-26 14:04 ` [PATCH 4/5] thermal: khadas_mcu_fan: add support for Khadas Edge 2 muhammed.efecetin.67
2025-06-26 14:11   ` neil.armstrong
2025-06-26 14:36     ` muhammed.efecetin.67
2025-06-26 14:46       ` neil.armstrong
2025-06-26 15:16         ` Muhammed Efe Cetin
2025-06-26 15:29           ` neil.armstrong
2025-06-26 14:04 ` [PATCH 5/5] arm64: dts: rockchip: add Khadas MCU and fan control nodes muhammed.efecetin.67

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=16807e13e034f85adc91d131f6c5046ce7d98d9c.1746518265.git.efectn@protonmail.com \
    --to=muhammed.efecetin.67@gmail.com \
    --cc=daniel.lezcano@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=efectn@protonmail.com \
    --cc=heiko@sntech.de \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=lee@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=neil.armstrong@linaro.org \
    --cc=rafael@kernel.org \
    --cc=robh+dt@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).