From patchwork Tue Aug 15 02:34:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiansheng Wu X-Patchwork-Id: 714001 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4855DC001DB for ; Tue, 15 Aug 2023 02:35:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234251AbjHOCfS (ORCPT ); Mon, 14 Aug 2023 22:35:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51060 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234262AbjHOCfH (ORCPT ); Mon, 14 Aug 2023 22:35:07 -0400 Received: from SHSQR01.spreadtrum.com (unknown [222.66.158.135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1012810D0; Mon, 14 Aug 2023 19:35:03 -0700 (PDT) Received: from dlp.unisoc.com ([10.29.3.86]) by SHSQR01.spreadtrum.com with ESMTP id 37F2YYVR066422; Tue, 15 Aug 2023 10:34:34 +0800 (+08) (envelope-from Jiansheng.Wu@unisoc.com) Received: from SHDLP.spreadtrum.com (shmbx05.spreadtrum.com [10.29.1.56]) by dlp.unisoc.com (SkyGuard) with ESMTPS id 4RPwK704pXz2P8CXW; Tue, 15 Aug 2023 10:32:27 +0800 (CST) Received: from xm9614pcu.spreadtrum.com (10.13.2.29) by shmbx05.spreadtrum.com (10.29.1.56) with Microsoft SMTP Server (TLS) id 15.0.1497.23; Tue, 15 Aug 2023 10:34:32 +0800 From: Jiansheng Wu To: Mark Brown , Orson Zhai , Baolin Wang , Chunyan Zhang CC: , , , , Subject: [PATCH 1/8] Spi: sprd-adi: Getting panic reason before reboot Date: Tue, 15 Aug 2023 10:34:19 +0800 Message-ID: <20230815023426.15076-1-jiansheng.wu@unisoc.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-Originating-IP: [10.13.2.29] X-ClientProxiedBy: SHCAS03.spreadtrum.com (10.0.1.207) To shmbx05.spreadtrum.com (10.29.1.56) X-MAIL: SHSQR01.spreadtrum.com 37F2YYVR066422 Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org Registered adi_panic_event to panic_notifier_list, that is used to get panic reason and judge restart causes before system reboot. It's can improve reboot reasons from panic. Signed-off-by: Jiansheng Wu --- drivers/spi/spi-sprd-adi.c | 46 ++++++++++++++++++++++++++++++++++---- 1 file changed, 42 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-sprd-adi.c b/drivers/spi/spi-sprd-adi.c index 22e39c4c12c4..dd00d63a3cd0 100644 --- a/drivers/spi/spi-sprd-adi.c +++ b/drivers/spi/spi-sprd-adi.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -128,6 +129,8 @@ #define WDG_LOAD_MASK GENMASK(15, 0) #define WDG_UNLOCK_KEY 0xe551 +#define PANIC_REASON_LEN_MAX 20 + struct sprd_adi_wdg { u32 base; u32 rst_sts; @@ -155,6 +158,31 @@ struct sprd_adi { const struct sprd_adi_data *data; }; +static char *panic_reason; +static int adi_panic_event(struct notifier_block *self, unsigned long val, void *reason) +{ + if (reason == NULL) + return 0; + + if (strlen(reason) < PANIC_REASON_LEN_MAX) + memcpy(panic_reason, reason, strlen(reason)); + else + memcpy(panic_reason, reason, PANIC_REASON_LEN_MAX); + + return 0; +} + +static struct notifier_block adi_panic_event_nb = { + .notifier_call = adi_panic_event, + .priority = INT_MAX, +}; + +static int adi_get_panic_reason_init(void) +{ + atomic_notifier_chain_register(&panic_notifier_list, &adi_panic_event_nb); + return 0; +} + static int sprd_adi_check_addr(struct sprd_adi *sadi, u32 reg) { if (reg >= sadi->data->slave_addr_size) { @@ -378,9 +406,15 @@ static int sprd_adi_restart(struct notifier_block *this, unsigned long mode, restart_handler); u32 val, reboot_mode = 0; - if (!cmd) - reboot_mode = HWRST_STATUS_NORMAL; - else if (!strncmp(cmd, "recovery", 8)) + if (!cmd) { + if (strlen(panic_reason)) { + reboot_mode = HWRST_STATUS_PANIC; + if (strstr(panic_reason, "tospanic")) + reboot_mode = HWRST_STATUS_SECURITY; + } else { + reboot_mode = HWRST_STATUS_NORMAL; + } + } else if (!strncmp(cmd, "recovery", 8)) reboot_mode = HWRST_STATUS_RECOVERY; else if (!strncmp(cmd, "alarm", 5)) reboot_mode = HWRST_STATUS_ALARM; @@ -520,6 +554,10 @@ static int sprd_adi_probe(struct platform_device *pdev) u16 num_chipselect; int ret; + panic_reason = devm_kzalloc(&pdev->dev, (sizeof(char))*PANIC_REASON_LEN_MAX, GFP_KERNEL); + if (!panic_reason) + return -ENOMEM; + if (!np) { dev_err(&pdev->dev, "can not find the adi bus node\n"); return -ENODEV; @@ -573,7 +611,7 @@ static int sprd_adi_probe(struct platform_device *pdev) } sprd_adi_hw_init(sadi); - + adi_get_panic_reason_init(); if (sadi->data->wdg_rst) sadi->data->wdg_rst(sadi); From patchwork Tue Aug 15 02:34:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiansheng Wu X-Patchwork-Id: 714000 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9099AC001E0 for ; Tue, 15 Aug 2023 02:35:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234257AbjHOCfS (ORCPT ); Mon, 14 Aug 2023 22:35:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51072 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234260AbjHOCfG (ORCPT ); Mon, 14 Aug 2023 22:35:06 -0400 Received: from SHSQR01.spreadtrum.com (unknown [222.66.158.135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CF95810F9; Mon, 14 Aug 2023 19:35:04 -0700 (PDT) Received: from dlp.unisoc.com ([10.29.3.86]) by SHSQR01.spreadtrum.com with ESMTP id 37F2YhuR066935; Tue, 15 Aug 2023 10:34:43 +0800 (+08) (envelope-from Jiansheng.Wu@unisoc.com) Received: from SHDLP.spreadtrum.com (shmbx05.spreadtrum.com [10.29.1.56]) by dlp.unisoc.com (SkyGuard) with ESMTPS id 4RPwKH2cFbz2PgxhY; Tue, 15 Aug 2023 10:32:35 +0800 (CST) Received: from xm9614pcu.spreadtrum.com (10.13.2.29) by shmbx05.spreadtrum.com (10.29.1.56) with Microsoft SMTP Server (TLS) id 15.0.1497.23; Tue, 15 Aug 2023 10:34:40 +0800 From: Jiansheng Wu To: Mark Brown , Orson Zhai , Baolin Wang , Chunyan Zhang CC: , , , , Subject: [PATCH 2/8] Spi: sprd-adi: Modify reboot method Date: Tue, 15 Aug 2023 10:34:20 +0800 Message-ID: <20230815023426.15076-2-jiansheng.wu@unisoc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230815023426.15076-1-jiansheng.wu@unisoc.com> References: <20230815023426.15076-1-jiansheng.wu@unisoc.com> MIME-Version: 1.0 X-Originating-IP: [10.13.2.29] X-ClientProxiedBy: SHCAS03.spreadtrum.com (10.0.1.207) To shmbx05.spreadtrum.com (10.29.1.56) X-MAIL: SHSQR01.spreadtrum.com 37F2YhuR066935 Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org Changing reboot mode on pmic, that write reset-reg to trigger reboot. Before this, It used watchdog to reboot system, that's not the best way. Signed-off-by: Xiaoqing Wu Signed-off-by: Jiansheng Wu --- drivers/spi/spi-sprd-adi.c | 117 ++++++++++++++----------------------- 1 file changed, 44 insertions(+), 73 deletions(-) diff --git a/drivers/spi/spi-sprd-adi.c b/drivers/spi/spi-sprd-adi.c index dd00d63a3cd0..734245492680 100644 --- a/drivers/spi/spi-sprd-adi.c +++ b/drivers/spi/spi-sprd-adi.c @@ -107,6 +107,14 @@ #define PMIC_MODULE_EN 0xc08 #define PMIC_CLK_EN 0xc18 #define PMIC_WDG_BASE 0x80 +#define SC2730_MODULE_EN 0x1808 +#define SC2730_CLK_EN 0x1810 +#define SC2730_WDG_BASE 0x40 +#define SC2730_RST_STATUS 0x1bac +#define SC2730_SWRST_CTRL0 0x1bf8 +#define SC2730_SOFT_RST_HW 0x1824 +#define REG_RST_EN BIT(4) +#define REG_SOFT_RST BIT(0) /* Definition of PMIC reset status register */ #define HWRST_STATUS_SECURITY 0x02 @@ -131,20 +139,16 @@ #define PANIC_REASON_LEN_MAX 20 -struct sprd_adi_wdg { - u32 base; - u32 rst_sts; - u32 wdg_en; - u32 wdg_clk; -}; - struct sprd_adi_data { u32 slave_offset; u32 slave_addr_size; int (*read_check)(u32 val, u32 reg); - int (*restart)(struct notifier_block *this, - unsigned long mode, void *cmd); - void (*wdg_rst)(void *p); + u32 rst_sts; + u32 swrst_base; + u32 softrst_base; + u32 wdg_base; + u32 wdg_en; + u32 wdg_clk; }; struct sprd_adi { @@ -386,21 +390,19 @@ static int sprd_adi_transfer_one(struct spi_controller *ctlr, return ret; } -static void sprd_adi_set_wdt_rst_mode(void *p) +static void sprd_adi_set_wdt_rst_mode(struct sprd_adi *sadi) { -#if IS_ENABLED(CONFIG_SPRD_WATCHDOG) +#if IS_ENABLED(CONFIG_SPRD_WATCHDOG) || IS_ENABLED(CONFIG_SPRD_WATCHDOG_FIQ) u32 val; - struct sprd_adi *sadi = (struct sprd_adi *)p; /* Init watchdog reset mode */ - sprd_adi_read(sadi, PMIC_RST_STATUS, &val); + sprd_adi_read(sadi, sadi->data->rst_sts, &val); val |= HWRST_STATUS_WATCHDOG; - sprd_adi_write(sadi, PMIC_RST_STATUS, val); + sprd_adi_write(sadi, sadi->data->rst_sts, val); #endif } -static int sprd_adi_restart(struct notifier_block *this, unsigned long mode, - void *cmd, struct sprd_adi_wdg *wdg) +static int sprd_adi_restart_handler(struct notifier_block *this, unsigned long mode, void *cmd) { struct sprd_adi *sadi = container_of(this, struct sprd_adi, restart_handler); @@ -442,40 +444,20 @@ static int sprd_adi_restart(struct notifier_block *this, unsigned long mode, reboot_mode = HWRST_STATUS_NORMAL; /* Record the reboot mode */ - sprd_adi_read(sadi, wdg->rst_sts, &val); - val &= ~HWRST_STATUS_WATCHDOG; + sprd_adi_read(sadi, sadi->data->rst_sts, &val); + val &= ~0xFF; val |= reboot_mode; - sprd_adi_write(sadi, wdg->rst_sts, val); - - /* Enable the interface clock of the watchdog */ - sprd_adi_read(sadi, wdg->wdg_en, &val); - val |= BIT_WDG_EN; - sprd_adi_write(sadi, wdg->wdg_en, val); - - /* Enable the work clock of the watchdog */ - sprd_adi_read(sadi, wdg->wdg_clk, &val); - val |= BIT_WDG_EN; - sprd_adi_write(sadi, wdg->wdg_clk, val); - - /* Unlock the watchdog */ - sprd_adi_write(sadi, wdg->base + REG_WDG_LOCK, WDG_UNLOCK_KEY); + sprd_adi_write(sadi, sadi->data->rst_sts, val); - sprd_adi_read(sadi, wdg->base + REG_WDG_CTRL, &val); - val |= BIT_WDG_NEW; - sprd_adi_write(sadi, wdg->base + REG_WDG_CTRL, val); + /*enable register reboot mode*/ + sprd_adi_read(sadi, sadi->data->swrst_base, &val); + val |= REG_RST_EN; + sprd_adi_write(sadi, sadi->data->swrst_base, val); - /* Load the watchdog timeout value, 50ms is always enough. */ - sprd_adi_write(sadi, wdg->base + REG_WDG_LOAD_HIGH, 0); - sprd_adi_write(sadi, wdg->base + REG_WDG_LOAD_LOW, - WDG_LOAD_VAL & WDG_LOAD_MASK); - - /* Start the watchdog to reset system */ - sprd_adi_read(sadi, wdg->base + REG_WDG_CTRL, &val); - val |= BIT_WDG_RUN | BIT_WDG_RST; - sprd_adi_write(sadi, wdg->base + REG_WDG_CTRL, val); - - /* Lock the watchdog */ - sprd_adi_write(sadi, wdg->base + REG_WDG_LOCK, ~WDG_UNLOCK_KEY); + /*enable soft reboot mode */ + sprd_adi_read(sadi, sadi->data->softrst_base, &val); + val |= REG_SOFT_RST; + sprd_adi_write(sadi, sadi->data->softrst_base, val); mdelay(1000); @@ -483,19 +465,6 @@ static int sprd_adi_restart(struct notifier_block *this, unsigned long mode, return NOTIFY_DONE; } -static int sprd_adi_restart_sc9860(struct notifier_block *this, - unsigned long mode, void *cmd) -{ - struct sprd_adi_wdg wdg = { - .base = PMIC_WDG_BASE, - .rst_sts = PMIC_RST_STATUS, - .wdg_en = PMIC_MODULE_EN, - .wdg_clk = PMIC_CLK_EN, - }; - - return sprd_adi_restart(this, mode, cmd, &wdg); -} - static void sprd_adi_hw_init(struct sprd_adi *sadi) { struct device_node *np = sadi->dev->of_node; @@ -612,8 +581,7 @@ static int sprd_adi_probe(struct platform_device *pdev) sprd_adi_hw_init(sadi); adi_get_panic_reason_init(); - if (sadi->data->wdg_rst) - sadi->data->wdg_rst(sadi); + sprd_adi_set_wdt_rst_mode(sadi); ctlr->dev.of_node = pdev->dev.of_node; ctlr->bus_num = pdev->id; @@ -628,14 +596,12 @@ static int sprd_adi_probe(struct platform_device *pdev) goto put_ctlr; } - if (sadi->data->restart) { - sadi->restart_handler.notifier_call = sadi->data->restart; - sadi->restart_handler.priority = 128; - ret = register_restart_handler(&sadi->restart_handler); - if (ret) { - dev_err(&pdev->dev, "can not register restart handler\n"); - goto put_ctlr; - } + sadi->restart_handler.notifier_call = sprd_adi_restart_handler; + sadi->restart_handler.priority = 130; + ret = register_restart_handler(&sadi->restart_handler); + if (ret) { + dev_err(&pdev->dev, "can not register restart handler\n"); + goto put_ctlr; } return 0; @@ -657,8 +623,10 @@ static struct sprd_adi_data sc9860_data = { .slave_offset = ADI_10BIT_SLAVE_OFFSET, .slave_addr_size = ADI_10BIT_SLAVE_ADDR_SIZE, .read_check = sprd_adi_read_check_r2, - .restart = sprd_adi_restart_sc9860, - .wdg_rst = sprd_adi_set_wdt_rst_mode, + .rst_sts = PMIC_RST_STATUS, + .wdg_base = PMIC_WDG_BASE, + .wdg_en = PMIC_MODULE_EN, + .wdg_clk = PMIC_CLK_EN, }; static struct sprd_adi_data sc9863_data = { @@ -671,6 +639,9 @@ static struct sprd_adi_data ums512_data = { .slave_offset = ADI_15BIT_SLAVE_OFFSET, .slave_addr_size = ADI_15BIT_SLAVE_ADDR_SIZE, .read_check = sprd_adi_read_check_r3, + .rst_sts = SC2730_RST_STATUS, + .swrst_base = SC2730_SWRST_CTRL0, + .softrst_base = SC2730_SOFT_RST_HW, }; static const struct of_device_id sprd_adi_of_match[] = { From patchwork Tue Aug 15 02:34:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiansheng Wu X-Patchwork-Id: 714604 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7C20BC41513 for ; Tue, 15 Aug 2023 02:35:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234264AbjHOCfT (ORCPT ); Mon, 14 Aug 2023 22:35:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234266AbjHOCfK (ORCPT ); Mon, 14 Aug 2023 22:35:10 -0400 Received: from SHSQR01.spreadtrum.com (mx1.unisoc.com [222.66.158.135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 79C3D10C1; Mon, 14 Aug 2023 19:35:09 -0700 (PDT) Received: from dlp.unisoc.com ([10.29.3.86]) by SHSQR01.spreadtrum.com with ESMTP id 37F2Ym7u067138; Tue, 15 Aug 2023 10:34:48 +0800 (+08) (envelope-from Jiansheng.Wu@unisoc.com) Received: from SHDLP.spreadtrum.com (shmbx05.spreadtrum.com [10.29.1.56]) by dlp.unisoc.com (SkyGuard) with ESMTPS id 4RPwKN1bytz2P8CXW; Tue, 15 Aug 2023 10:32:40 +0800 (CST) Received: from xm9614pcu.spreadtrum.com (10.13.2.29) by shmbx05.spreadtrum.com (10.29.1.56) with Microsoft SMTP Server (TLS) id 15.0.1497.23; Tue, 15 Aug 2023 10:34:45 +0800 From: Jiansheng Wu To: Mark Brown , Orson Zhai , Baolin Wang , Chunyan Zhang CC: , , , , Subject: [PATCH 3/8] Spi: sprd-adi: Added the cause of reboot Date: Tue, 15 Aug 2023 10:34:21 +0800 Message-ID: <20230815023426.15076-3-jiansheng.wu@unisoc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230815023426.15076-1-jiansheng.wu@unisoc.com> References: <20230815023426.15076-1-jiansheng.wu@unisoc.com> MIME-Version: 1.0 X-Originating-IP: [10.13.2.29] X-ClientProxiedBy: SHCAS03.spreadtrum.com (10.0.1.207) To shmbx05.spreadtrum.com (10.29.1.56) X-MAIL: SHSQR01.spreadtrum.com 37F2Ym7u067138 Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org Added the silent and dmverity methods to reboot mode that the system need enter the silent or secboot mode after restarting system. Signed-off-by: Jiansheng Wu --- drivers/spi/spi-sprd-adi.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/spi/spi-sprd-adi.c b/drivers/spi/spi-sprd-adi.c index 734245492680..569a66943e8d 100644 --- a/drivers/spi/spi-sprd-adi.c +++ b/drivers/spi/spi-sprd-adi.c @@ -118,6 +118,7 @@ /* Definition of PMIC reset status register */ #define HWRST_STATUS_SECURITY 0x02 +#define HWRST_STATUS_SECBOOT 0x03 #define HWRST_STATUS_RECOVERY 0x20 #define HWRST_STATUS_NORMAL 0x40 #define HWRST_STATUS_ALARM 0x50 @@ -129,6 +130,7 @@ #define HWRST_STATUS_AUTODLOADER 0xa0 #define HWRST_STATUS_IQMODE 0xb0 #define HWRST_STATUS_SPRDISK 0xc0 +#define HWRST_STATUS_SILENT 0xd0 #define HWRST_STATUS_FACTORYTEST 0xe0 #define HWRST_STATUS_WATCHDOG 0xf0 @@ -438,8 +440,12 @@ static int sprd_adi_restart_handler(struct notifier_block *this, unsigned long m reboot_mode = HWRST_STATUS_SPRDISK; else if (!strncmp(cmd, "tospanic", 8)) reboot_mode = HWRST_STATUS_SECURITY; + else if (!strncmp(cmd, "dm-verity", 9)) + reboot_mode = HWRST_STATUS_SECBOOT; else if (!strncmp(cmd, "factorytest", 11)) reboot_mode = HWRST_STATUS_FACTORYTEST; + else if (!strncmp(cmd, "silent", 6)) + reboot_mode = HWRST_STATUS_SILENT; else reboot_mode = HWRST_STATUS_NORMAL; From patchwork Tue Aug 15 02:34:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiansheng Wu X-Patchwork-Id: 714605 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6C04DC04A6A for ; Tue, 15 Aug 2023 02:35:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234286AbjHOCfU (ORCPT ); Mon, 14 Aug 2023 22:35:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52636 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234285AbjHOCfR (ORCPT ); Mon, 14 Aug 2023 22:35:17 -0400 Received: from SHSQR01.spreadtrum.com (unknown [222.66.158.135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B372B10C1; Mon, 14 Aug 2023 19:35:15 -0700 (PDT) Received: from dlp.unisoc.com ([10.29.3.86]) by SHSQR01.spreadtrum.com with ESMTP id 37F2Ys2f067436; Tue, 15 Aug 2023 10:34:54 +0800 (+08) (envelope-from Jiansheng.Wu@unisoc.com) Received: from SHDLP.spreadtrum.com (shmbx05.spreadtrum.com [10.29.1.56]) by dlp.unisoc.com (SkyGuard) with ESMTPS id 4RPwKV32gXz2P8CXW; Tue, 15 Aug 2023 10:32:46 +0800 (CST) Received: from xm9614pcu.spreadtrum.com (10.13.2.29) by shmbx05.spreadtrum.com (10.29.1.56) with Microsoft SMTP Server (TLS) id 15.0.1497.23; Tue, 15 Aug 2023 10:34:51 +0800 From: Jiansheng Wu To: Mark Brown , Orson Zhai , Baolin Wang , Chunyan Zhang CC: , , , , Subject: [PATCH 4/8] Spi: sprd-adi: Supported multi parameter configurations Date: Tue, 15 Aug 2023 10:34:22 +0800 Message-ID: <20230815023426.15076-4-jiansheng.wu@unisoc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230815023426.15076-1-jiansheng.wu@unisoc.com> References: <20230815023426.15076-1-jiansheng.wu@unisoc.com> MIME-Version: 1.0 X-Originating-IP: [10.13.2.29] X-ClientProxiedBy: SHCAS03.spreadtrum.com (10.0.1.207) To shmbx05.spreadtrum.com (10.29.1.56) X-MAIL: SHSQR01.spreadtrum.com 37F2Ys2f067436 Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org It is supporting multi hardware and multi config on adi driver. That we can define different parameter on boards' dts, and configure cannels on adi-device. Signed-off-by: Jiansheng Wu --- drivers/spi/spi-sprd-adi.c | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/drivers/spi/spi-sprd-adi.c b/drivers/spi/spi-sprd-adi.c index 569a66943e8d..eea64d20279e 100644 --- a/drivers/spi/spi-sprd-adi.c +++ b/drivers/spi/spi-sprd-adi.c @@ -140,6 +140,8 @@ #define WDG_UNLOCK_KEY 0xe551 #define PANIC_REASON_LEN_MAX 20 +/*Adi single soft multi hard*/ +#define SPRD_ADI_MAGIC_LEN_MAX 5 struct sprd_adi_data { u32 slave_offset; @@ -471,12 +473,40 @@ static int sprd_adi_restart_handler(struct notifier_block *this, unsigned long m return NOTIFY_DONE; } +static void sprd_adi_power_ssmh(char *adi_supply) +{ + struct device_node *cmdline_node; + const char *cmd_line, *adi_type; + char adi_value[SPRD_ADI_MAGIC_LEN_MAX] = ""; + int ret; + + cmdline_node = of_find_node_by_path("/chosen"); + ret = of_property_read_string(cmdline_node, "bootargs", &cmd_line); + if (ret) { + pr_err("can't parse bootargs property\n"); + return; + } + + adi_type = strstr(cmd_line, "power.from.extern="); + if (!adi_type) { + pr_err("can't find power.from.extern\n"); + return; + } + + sscanf(adi_type, "power.from.extern=%s\n", adi_value); + if (!adi_value[0]) + return; + + strcat(adi_supply, adi_value); +} + static void sprd_adi_hw_init(struct sprd_adi *sadi) { struct device_node *np = sadi->dev->of_node; int i, size, chn_cnt; const __be32 *list; u32 tmp; + char adi_supply[25] = "sprd,hw-channels"; /* Set all channels as default priority */ writel_relaxed(0, sadi->base + REG_ADI_CHN_PRIL); @@ -488,7 +518,10 @@ static void sprd_adi_hw_init(struct sprd_adi *sadi) writel_relaxed(tmp, sadi->base + REG_ADI_GSSI_CFG0); /* Set hardware channels setting */ - list = of_get_property(np, "sprd,hw-channels", &size); + sprd_adi_power_ssmh(adi_supply); + dev_info(sadi->dev, "adi supply is %s\n", adi_supply); + + list = of_get_property(np, adi_supply, &size); if (!list || !size) { dev_info(sadi->dev, "no hw channels setting in node\n"); return; From patchwork Tue Aug 15 02:34:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiansheng Wu X-Patchwork-Id: 713999 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 60F55C001DB for ; Tue, 15 Aug 2023 02:36:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234255AbjHOCft (ORCPT ); Mon, 14 Aug 2023 22:35:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52658 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234265AbjHOCfU (ORCPT ); Mon, 14 Aug 2023 22:35:20 -0400 Received: from SHSQR01.spreadtrum.com (unknown [222.66.158.135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C7CC210C1; Mon, 14 Aug 2023 19:35:18 -0700 (PDT) Received: from dlp.unisoc.com ([10.29.3.86]) by SHSQR01.spreadtrum.com with ESMTP id 37F2Ythv067477; Tue, 15 Aug 2023 10:34:55 +0800 (+08) (envelope-from Jiansheng.Wu@unisoc.com) Received: from SHDLP.spreadtrum.com (shmbx05.spreadtrum.com [10.29.1.56]) by dlp.unisoc.com (SkyGuard) with ESMTPS id 4RPwKW3cwjz2PgxhY; Tue, 15 Aug 2023 10:32:47 +0800 (CST) Received: from xm9614pcu.spreadtrum.com (10.13.2.29) by shmbx05.spreadtrum.com (10.29.1.56) with Microsoft SMTP Server (TLS) id 15.0.1497.23; Tue, 15 Aug 2023 10:34:52 +0800 From: Jiansheng Wu To: Mark Brown , Orson Zhai , Baolin Wang , Chunyan Zhang CC: , , , , Subject: [PATCH 5/8] Spi: sprd-adi: Checking panic reason from sml Date: Tue, 15 Aug 2023 10:34:23 +0800 Message-ID: <20230815023426.15076-5-jiansheng.wu@unisoc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230815023426.15076-1-jiansheng.wu@unisoc.com> References: <20230815023426.15076-1-jiansheng.wu@unisoc.com> MIME-Version: 1.0 X-Originating-IP: [10.13.2.29] X-ClientProxiedBy: SHCAS03.spreadtrum.com (10.0.1.207) To shmbx05.spreadtrum.com (10.29.1.56) X-MAIL: SHSQR01.spreadtrum.com 37F2Ythv067477 Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org Checking panic reason from sml and recording reboot mode to pmic's reg. It used to check reboot reason on next boot. Signed-off-by: XiaoQing Wu Signed-off-by: Jiansheng Wu --- drivers/spi/spi-sprd-adi.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-sprd-adi.c b/drivers/spi/spi-sprd-adi.c index eea64d20279e..c31035fffe4c 100644 --- a/drivers/spi/spi-sprd-adi.c +++ b/drivers/spi/spi-sprd-adi.c @@ -119,6 +119,7 @@ /* Definition of PMIC reset status register */ #define HWRST_STATUS_SECURITY 0x02 #define HWRST_STATUS_SECBOOT 0x03 +#define HWRST_STATUS_SML_PANIC 0x04 #define HWRST_STATUS_RECOVERY 0x20 #define HWRST_STATUS_NORMAL 0x40 #define HWRST_STATUS_ALARM 0x50 @@ -410,7 +411,7 @@ static int sprd_adi_restart_handler(struct notifier_block *this, unsigned long m { struct sprd_adi *sadi = container_of(this, struct sprd_adi, restart_handler); - u32 val, reboot_mode = 0; + u32 val = 0, reboot_mode = 0, sml_mode; if (!cmd) { if (strlen(panic_reason)) { @@ -453,9 +454,12 @@ static int sprd_adi_restart_handler(struct notifier_block *this, unsigned long m /* Record the reboot mode */ sprd_adi_read(sadi, sadi->data->rst_sts, &val); - val &= ~0xFF; - val |= reboot_mode; - sprd_adi_write(sadi, sadi->data->rst_sts, val); + sml_mode = val & 0xFF; + if (sml_mode != HWRST_STATUS_SML_PANIC && sml_mode != HWRST_STATUS_SECURITY) { + val &= ~0xFF; + val |= reboot_mode; + sprd_adi_write(sadi, sadi->data->rst_sts, val); + } /*enable register reboot mode*/ sprd_adi_read(sadi, sadi->data->swrst_base, &val); From patchwork Tue Aug 15 02:34:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiansheng Wu X-Patchwork-Id: 714603 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AC2AAC04A6A for ; Tue, 15 Aug 2023 02:36:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234271AbjHOCfu (ORCPT ); Mon, 14 Aug 2023 22:35:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36974 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234324AbjHOCf1 (ORCPT ); Mon, 14 Aug 2023 22:35:27 -0400 Received: from SHSQR01.spreadtrum.com (mx1.unisoc.com [222.66.158.135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8BF2A1737; Mon, 14 Aug 2023 19:35:25 -0700 (PDT) Received: from dlp.unisoc.com ([10.29.3.86]) by SHSQR01.spreadtrum.com with ESMTP id 37F2YuZY067520; Tue, 15 Aug 2023 10:34:56 +0800 (+08) (envelope-from Jiansheng.Wu@unisoc.com) Received: from SHDLP.spreadtrum.com (shmbx05.spreadtrum.com [10.29.1.56]) by dlp.unisoc.com (SkyGuard) with ESMTPS id 4RPwKX4BLQz2PgxhZ; Tue, 15 Aug 2023 10:32:48 +0800 (CST) Received: from xm9614pcu.spreadtrum.com (10.13.2.29) by shmbx05.spreadtrum.com (10.29.1.56) with Microsoft SMTP Server (TLS) id 15.0.1497.23; Tue, 15 Aug 2023 10:34:53 +0800 From: Jiansheng Wu To: Mark Brown , Orson Zhai , Baolin Wang , Chunyan Zhang CC: , , , , Subject: [PATCH 6/8] Spi: sprd-adi: Supported adi controller on UMS9620 Date: Tue, 15 Aug 2023 10:34:24 +0800 Message-ID: <20230815023426.15076-6-jiansheng.wu@unisoc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230815023426.15076-1-jiansheng.wu@unisoc.com> References: <20230815023426.15076-1-jiansheng.wu@unisoc.com> MIME-Version: 1.0 X-Originating-IP: [10.13.2.29] X-ClientProxiedBy: SHCAS03.spreadtrum.com (10.0.1.207) To shmbx05.spreadtrum.com (10.29.1.56) X-MAIL: SHSQR01.spreadtrum.com 37F2YuZY067520 Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org Added ADI-controller on UMS9620 and reset regs on UMP9620, that is a PMIC SoC integrated in UMS9620. Signed-off-by: XiaoQing Wu Signed-off-by: Jiansheng Wu --- drivers/spi/spi-sprd-adi.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/spi/spi-sprd-adi.c b/drivers/spi/spi-sprd-adi.c index c31035fffe4c..0b20c228e119 100644 --- a/drivers/spi/spi-sprd-adi.c +++ b/drivers/spi/spi-sprd-adi.c @@ -111,6 +111,9 @@ #define SC2730_CLK_EN 0x1810 #define SC2730_WDG_BASE 0x40 #define SC2730_RST_STATUS 0x1bac +#define UMP9620_RST_STATUS 0x23ac +#define UMP9620_SWRST_CTRL0 0x23f8 +#define UMP9620_SOFT_RST_HW 0x2024 #define SC2730_SWRST_CTRL0 0x1bf8 #define SC2730_SOFT_RST_HW 0x1824 #define REG_RST_EN BIT(4) @@ -687,6 +690,14 @@ static struct sprd_adi_data ums512_data = { .softrst_base = SC2730_SOFT_RST_HW, }; +static struct sprd_adi_data ums9620_data = { + .slave_offset = ADI_15BIT_SLAVE_OFFSET, + .slave_addr_size = ADI_15BIT_SLAVE_ADDR_SIZE, + .rst_sts = UMP9620_RST_STATUS, + .swrst_base = UMP9620_SWRST_CTRL0, + .softrst_base = UMP9620_SOFT_RST_HW, +}; + static const struct of_device_id sprd_adi_of_match[] = { { .compatible = "sprd,sc9860-adi", @@ -700,6 +711,10 @@ static const struct of_device_id sprd_adi_of_match[] = { .compatible = "sprd,ums512-adi", .data = &ums512_data, }, + { + .compatible = "sprd,ums9620-adi", + .data = &ums9620_data, + }, { }, }; MODULE_DEVICE_TABLE(of, sprd_adi_of_match); From patchwork Tue Aug 15 02:34:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiansheng Wu X-Patchwork-Id: 714602 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C9B13C41513 for ; Tue, 15 Aug 2023 02:36:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234276AbjHOCfu (ORCPT ); Mon, 14 Aug 2023 22:35:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234323AbjHOCf1 (ORCPT ); Mon, 14 Aug 2023 22:35:27 -0400 Received: from SHSQR01.spreadtrum.com (unknown [222.66.158.135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 28D6010D0; Mon, 14 Aug 2023 19:35:26 -0700 (PDT) Received: from dlp.unisoc.com ([10.29.3.86]) by SHSQR01.spreadtrum.com with ESMTP id 37F2YvbZ067529; Tue, 15 Aug 2023 10:34:57 +0800 (+08) (envelope-from Jiansheng.Wu@unisoc.com) Received: from SHDLP.spreadtrum.com (shmbx05.spreadtrum.com [10.29.1.56]) by dlp.unisoc.com (SkyGuard) with ESMTPS id 4RPwKY5TqTz2P8CXW; Tue, 15 Aug 2023 10:32:49 +0800 (CST) Received: from xm9614pcu.spreadtrum.com (10.13.2.29) by shmbx05.spreadtrum.com (10.29.1.56) with Microsoft SMTP Server (TLS) id 15.0.1497.23; Tue, 15 Aug 2023 10:34:55 +0800 From: Jiansheng Wu To: Mark Brown , Orson Zhai , Baolin Wang , Chunyan Zhang CC: , , , , Subject: [PATCH 7/8] Spi: sprd-adi: Waiting write_cmd is finished Date: Tue, 15 Aug 2023 10:34:25 +0800 Message-ID: <20230815023426.15076-7-jiansheng.wu@unisoc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230815023426.15076-1-jiansheng.wu@unisoc.com> References: <20230815023426.15076-1-jiansheng.wu@unisoc.com> MIME-Version: 1.0 X-Originating-IP: [10.13.2.29] X-ClientProxiedBy: SHCAS03.spreadtrum.com (10.0.1.207) To shmbx05.spreadtrum.com (10.29.1.56) X-MAIL: SHSQR01.spreadtrum.com 37F2YvbZ067529 Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org Checeking state on write_cmd, and return flag of result. It is a new function on UMS9620 to verify that the data transfer is complete. Signed-off-by: XiaoQing Wu Signed-off-by: Jiansheng Wu --- drivers/spi/spi-sprd-adi.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/drivers/spi/spi-sprd-adi.c b/drivers/spi/spi-sprd-adi.c index 0b20c228e119..8c518c227549 100644 --- a/drivers/spi/spi-sprd-adi.c +++ b/drivers/spi/spi-sprd-adi.c @@ -48,6 +48,7 @@ #define RD_ADDR_MASK GENMASK(30, 16) /* Bits definitions for register REG_ADI_ARM_FIFO_STS */ +#define BIT_ARM_WR_FREQ BIT(31) #define BIT_FIFO_FULL BIT(11) #define BIT_FIFO_EMPTY BIT(10) @@ -78,6 +79,7 @@ #define ADI_FIFO_DRAIN_TIMEOUT 1000 #define ADI_READ_TIMEOUT 2000 +#define ADI_WRITE_TIMEOUT 2000 /* * Read back address from REG_ADI_RD_DATA bit[30:16] which maps to: @@ -150,6 +152,7 @@ struct sprd_adi_data { u32 slave_offset; u32 slave_addr_size; + int (*write_wait)(void __iomem *adi_base); int (*read_check)(u32 val, u32 reg); u32 rst_sts; u32 swrst_base; @@ -247,6 +250,22 @@ static int sprd_adi_read_check(u32 val, u32 addr) return 0; } +static int sprd_adi_write_wait(void __iomem *adi_base) +{ + unsigned int write_timeout = ADI_WRITE_TIMEOUT; + u32 val; + + do { + val = readl_relaxed(adi_base + REG_ADI_ARM_FIFO_STS); + if (!(val & BIT_ARM_WR_FREQ)) + return 0; + cpu_relax(); + } while (--write_timeout); + + pr_err("ADI write fail, sts = 0x%02x\n", val); + return -EBUSY; +} + static int sprd_adi_read_check_r2(u32 val, u32 reg) { return sprd_adi_read_check(val, reg & RDBACK_ADDR_MASK_R2); @@ -365,8 +384,12 @@ static int sprd_adi_write(struct sprd_adi *sadi, u32 reg, u32 val) if (timeout == 0) { dev_err(sadi->dev, "write fifo is full\n"); ret = -EBUSY; + goto out; } + if (sadi->data->write_wait) + ret = sadi->data->write_wait(sadi->base); + out: if (sadi->hwlock) hwspin_unlock_irqrestore(sadi->hwlock, &flags); @@ -691,6 +714,7 @@ static struct sprd_adi_data ums512_data = { }; static struct sprd_adi_data ums9620_data = { + .write_wait = sprd_adi_write_wait, .slave_offset = ADI_15BIT_SLAVE_OFFSET, .slave_addr_size = ADI_15BIT_SLAVE_ADDR_SIZE, .rst_sts = UMP9620_RST_STATUS, From patchwork Tue Aug 15 02:34:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiansheng Wu X-Patchwork-Id: 713998 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0D7ADC04FDF for ; Tue, 15 Aug 2023 02:36:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234284AbjHOCfv (ORCPT ); Mon, 14 Aug 2023 22:35:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52296 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234345AbjHOCfg (ORCPT ); Mon, 14 Aug 2023 22:35:36 -0400 Received: from SHSQR01.spreadtrum.com (unknown [222.66.158.135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E0013198D; Mon, 14 Aug 2023 19:35:28 -0700 (PDT) Received: from dlp.unisoc.com ([10.29.3.86]) by SHSQR01.spreadtrum.com with ESMTP id 37F2YwpO067565; Tue, 15 Aug 2023 10:34:58 +0800 (+08) (envelope-from Jiansheng.Wu@unisoc.com) Received: from SHDLP.spreadtrum.com (shmbx05.spreadtrum.com [10.29.1.56]) by dlp.unisoc.com (SkyGuard) with ESMTPS id 4RPwKZ6cSCz2P8CXW; Tue, 15 Aug 2023 10:32:50 +0800 (CST) Received: from xm9614pcu.spreadtrum.com (10.13.2.29) by shmbx05.spreadtrum.com (10.29.1.56) with Microsoft SMTP Server (TLS) id 15.0.1497.23; Tue, 15 Aug 2023 10:34:56 +0800 From: Jiansheng Wu To: Mark Brown , Orson Zhai , Baolin Wang , Chunyan Zhang CC: , , , , Subject: [PATCH 8/8] spi: add sprd ADI for UMS9620 Date: Tue, 15 Aug 2023 10:34:26 +0800 Message-ID: <20230815023426.15076-8-jiansheng.wu@unisoc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230815023426.15076-1-jiansheng.wu@unisoc.com> References: <20230815023426.15076-1-jiansheng.wu@unisoc.com> MIME-Version: 1.0 X-Originating-IP: [10.13.2.29] X-ClientProxiedBy: SHCAS03.spreadtrum.com (10.0.1.207) To shmbx05.spreadtrum.com (10.29.1.56) X-MAIL: SHSQR01.spreadtrum.com 37F2YwpO067565 Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org This patch adds support for UMS9620. Signed-off-by: Jiansheng Wu --- Documentation/devicetree/bindings/spi/sprd,spi-adi.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/spi/sprd,spi-adi.yaml b/Documentation/devicetree/bindings/spi/sprd,spi-adi.yaml index 903b06f88b1b..8efea6dfcf25 100644 --- a/Documentation/devicetree/bindings/spi/sprd,spi-adi.yaml +++ b/Documentation/devicetree/bindings/spi/sprd,spi-adi.yaml @@ -51,6 +51,7 @@ properties: - sprd,sc9860-adi - sprd,sc9863-adi - sprd,ums512-adi + - sprd,ums9620-adi reg: maxItems: 1