From patchwork Fri Apr 2 00:47:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zev Weiss X-Patchwork-Id: 415123 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C9C02C433B4 for ; Fri, 2 Apr 2021 00:47:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AE25061108 for ; Fri, 2 Apr 2021 00:47:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233911AbhDBArc (ORCPT ); Thu, 1 Apr 2021 20:47:32 -0400 Received: from thorn.bewilderbeest.net ([71.19.156.171]:37985 "EHLO thorn.bewilderbeest.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231179AbhDBAra (ORCPT ); Thu, 1 Apr 2021 20:47:30 -0400 Received: from hatter.bewilderbeest.net (unknown [IPv6:2600:6c44:7f:ba20::7c6]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: zev) by thorn.bewilderbeest.net (Postfix) with ESMTPSA id 49A4766C; Thu, 1 Apr 2021 17:47:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bewilderbeest.net; s=thorn; t=1617324450; bh=HUuWcisgz8mM0j4K+ChnHj6gISdfazbbEe9S9nqNiL0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fsi59j2u4pDUkphWfoAPzzlb+deVykDamP5bGLzw0UbpDznBfSNvKsznlLR96dD5d M0eHugf76C2KPTxgxqmGtyoJJpzdV5qV1uyHHhVXjjPKXwO+6gtrCiYXiU/4YIAd+V TuFKG4klOxUAoH2DpcQPAEPii5svqXK/BvKWZUcM= From: Zev Weiss To: Joel Stanley Cc: openbmc@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org, linux-kernel@vger.kernel.org, Andrew Jeffery , Zev Weiss , Greg Kroah-Hartman , Rob Herring , Lubomir Rintel , - , linux-serial@vger.kernel.org Subject: [PATCH v3 1/4] dt-bindings: serial: 8250: deprecate aspeed, sirq-polarity-sense Date: Thu, 1 Apr 2021 19:47:13 -0500 Message-Id: <20210402004716.15961-2-zev@bewilderbeest.net> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210402004716.15961-1-zev@bewilderbeest.net> References: <20210402004716.15961-1-zev@bewilderbeest.net> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org This property ties SIRQ polarity to SCU register bits that don't necessarily have any direct relationship to it; the only use of it was removed in commit c82bf6e133d30e0f9172a20807814fa28aef0f67. Signed-off-by: Zev Weiss Reviewed-by: Joel Stanley --- Documentation/devicetree/bindings/serial/8250.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/serial/8250.yaml b/Documentation/devicetree/bindings/serial/8250.yaml index f54cae9ff7b2..491b9297432d 100644 --- a/Documentation/devicetree/bindings/serial/8250.yaml +++ b/Documentation/devicetree/bindings/serial/8250.yaml @@ -188,6 +188,7 @@ properties: offset and bit number to identify how the SIRQ polarity should be configured. One possible data source is the LPC/eSPI mode bit. Only applicable to aspeed,ast2500-vuart. + deprecated: true required: - reg From patchwork Fri Apr 2 00:47:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zev Weiss X-Patchwork-Id: 414806 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E1BEAC433B4 for ; Fri, 2 Apr 2021 00:47:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BB3AA6117A for ; Fri, 2 Apr 2021 00:47:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234023AbhDBArf (ORCPT ); Thu, 1 Apr 2021 20:47:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233974AbhDBAre (ORCPT ); Thu, 1 Apr 2021 20:47:34 -0400 Received: from thorn.bewilderbeest.net (thorn.bewilderbeest.net [IPv6:2605:2700:0:5::4713:9cab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 602EBC0613E6; Thu, 1 Apr 2021 17:47:32 -0700 (PDT) Received: from hatter.bewilderbeest.net (unknown [IPv6:2600:6c44:7f:ba20::7c6]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: zev) by thorn.bewilderbeest.net (Postfix) with ESMTPSA id B6F3B671; Thu, 1 Apr 2021 17:47:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bewilderbeest.net; s=thorn; t=1617324452; bh=dkNOm/h1qSphcHi2Oe/aIN2quBfOKYQTuInyf8XmA4o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=i1nIN/xH2+t6MgkBClw9veB0szgRwXne3kNEL/Ponb+rVphEwO3xCLvDZQDejow1r IABoeslNa6AeKju7X+5/cZI06EGlmHcJEKivjwe7BMu8qDnNV3siNHo6Tmsre76l/X 6f/GNhSuEjNa7W5PkbjPyoaZrpWiVa0cjCrPKRhY= From: Zev Weiss To: Joel Stanley Cc: openbmc@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org, linux-kernel@vger.kernel.org, Andrew Jeffery , Zev Weiss , Greg Kroah-Hartman , Jiri Slaby , linux-serial@vger.kernel.org Subject: [PATCH v3 2/4] drivers/tty/serial/8250: refactor sirq and lpc address setting code Date: Thu, 1 Apr 2021 19:47:14 -0500 Message-Id: <20210402004716.15961-3-zev@bewilderbeest.net> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210402004716.15961-1-zev@bewilderbeest.net> References: <20210402004716.15961-1-zev@bewilderbeest.net> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org This splits dedicated aspeed_vuart_set_{sirq,lpc_address}() functions out of the sysfs store functions in preparation for adding DT properties that will be poking the same registers. While we're at it, these functions now provide some basic bounds-checking on their arguments. Signed-off-by: Zev Weiss --- drivers/tty/serial/8250/8250_aspeed_vuart.c | 51 ++++++++++++++------- 1 file changed, 35 insertions(+), 16 deletions(-) diff --git a/drivers/tty/serial/8250/8250_aspeed_vuart.c b/drivers/tty/serial/8250/8250_aspeed_vuart.c index c33e02cbde93..8433f8dbb186 100644 --- a/drivers/tty/serial/8250/8250_aspeed_vuart.c +++ b/drivers/tty/serial/8250/8250_aspeed_vuart.c @@ -72,22 +72,31 @@ static ssize_t lpc_address_show(struct device *dev, return snprintf(buf, PAGE_SIZE - 1, "0x%x\n", addr); } +static int aspeed_vuart_set_lpc_address(struct aspeed_vuart *vuart, u32 addr) +{ + if (addr > U16_MAX) + return -EINVAL; + + writeb(addr >> 8, vuart->regs + ASPEED_VUART_ADDRH); + writeb(addr >> 0, vuart->regs + ASPEED_VUART_ADDRL); + + return 0; +} + static ssize_t lpc_address_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct aspeed_vuart *vuart = dev_get_drvdata(dev); - unsigned long val; + u32 val; int err; - err = kstrtoul(buf, 0, &val); + err = kstrtou32(buf, 0, &val); if (err) return err; - writeb(val >> 8, vuart->regs + ASPEED_VUART_ADDRH); - writeb(val >> 0, vuart->regs + ASPEED_VUART_ADDRL); - - return count; + err = aspeed_vuart_set_lpc_address(vuart, val); + return err ? : count; } static DEVICE_ATTR_RW(lpc_address); @@ -105,27 +114,37 @@ static ssize_t sirq_show(struct device *dev, return snprintf(buf, PAGE_SIZE - 1, "%u\n", reg); } +static int aspeed_vuart_set_sirq(struct aspeed_vuart *vuart, u32 sirq) +{ + u8 reg; + + if (sirq > (ASPEED_VUART_GCRB_HOST_SIRQ_MASK >> ASPEED_VUART_GCRB_HOST_SIRQ_SHIFT)) + return -EINVAL; + + sirq <<= ASPEED_VUART_GCRB_HOST_SIRQ_SHIFT; + sirq &= ASPEED_VUART_GCRB_HOST_SIRQ_MASK; + + reg = readb(vuart->regs + ASPEED_VUART_GCRB); + reg &= ~ASPEED_VUART_GCRB_HOST_SIRQ_MASK; + reg |= sirq; + writeb(reg, vuart->regs + ASPEED_VUART_GCRB); + + return 0; +} + static ssize_t sirq_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct aspeed_vuart *vuart = dev_get_drvdata(dev); unsigned long val; int err; - u8 reg; err = kstrtoul(buf, 0, &val); if (err) return err; - val <<= ASPEED_VUART_GCRB_HOST_SIRQ_SHIFT; - val &= ASPEED_VUART_GCRB_HOST_SIRQ_MASK; - - reg = readb(vuart->regs + ASPEED_VUART_GCRB); - reg &= ~ASPEED_VUART_GCRB_HOST_SIRQ_MASK; - reg |= val; - writeb(reg, vuart->regs + ASPEED_VUART_GCRB); - - return count; + err = aspeed_vuart_set_sirq(vuart, val); + return err ? : count; } static DEVICE_ATTR_RW(sirq); From patchwork Fri Apr 2 00:47:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zev Weiss X-Patchwork-Id: 415122 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A44F9C433B4 for ; Fri, 2 Apr 2021 00:47:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 827AD61108 for ; Fri, 2 Apr 2021 00:47:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234106AbhDBArj (ORCPT ); Thu, 1 Apr 2021 20:47:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38286 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234008AbhDBArf (ORCPT ); Thu, 1 Apr 2021 20:47:35 -0400 Received: from thorn.bewilderbeest.net (thorn.bewilderbeest.net [IPv6:2605:2700:0:5::4713:9cab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 18CCAC061788; Thu, 1 Apr 2021 17:47:35 -0700 (PDT) Received: from hatter.bewilderbeest.net (unknown [IPv6:2600:6c44:7f:ba20::7c6]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: zev) by thorn.bewilderbeest.net (Postfix) with ESMTPSA id 11AA78FB; Thu, 1 Apr 2021 17:47:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bewilderbeest.net; s=thorn; t=1617324454; bh=3xOUL4AIGVOffUxK324A/zK7JsmBLvhsbsncOdBEzDA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VPvqQcu2kzZzejl3tEJu1wjVRERQL3pkZa2lEAWPVoOuSjeN4FV5K7FkxyNGsf9a4 zyZp8nM7RN/T5PglyJVZh6zTDv74uM3cShpQ082uJoceKu1IhTklNlMYKtUe7KYBJF qLhpqNQBavvweFs6z7PwC4FeHe8hmyrrLmDhgMR0= From: Zev Weiss To: Joel Stanley Cc: openbmc@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org, linux-kernel@vger.kernel.org, Andrew Jeffery , Zev Weiss , Greg Kroah-Hartman , Jiri Slaby , linux-serial@vger.kernel.org Subject: [PATCH v3 3/4] drivers/tty/serial/8250: add aspeed, lpc-address and aspeed, sirq DT properties Date: Thu, 1 Apr 2021 19:47:15 -0500 Message-Id: <20210402004716.15961-4-zev@bewilderbeest.net> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210402004716.15961-1-zev@bewilderbeest.net> References: <20210402004716.15961-1-zev@bewilderbeest.net> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org These allow describing all the Aspeed VUART attributes currently available via sysfs. aspeed,sirq provides a replacement for the deprecated aspeed,sirq-polarity-sense property. Signed-off-by: Zev Weiss --- drivers/tty/serial/8250/8250_aspeed_vuart.c | 44 ++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/drivers/tty/serial/8250/8250_aspeed_vuart.c b/drivers/tty/serial/8250/8250_aspeed_vuart.c index 8433f8dbb186..10b1f33386e6 100644 --- a/drivers/tty/serial/8250/8250_aspeed_vuart.c +++ b/drivers/tty/serial/8250/8250_aspeed_vuart.c @@ -28,6 +28,10 @@ #define ASPEED_VUART_ADDRL 0x28 #define ASPEED_VUART_ADDRH 0x2c +#define ASPEED_VUART_DEFAULT_LPC_ADDR 0x3f8 +#define ASPEED_VUART_DEFAULT_SIRQ 4 +#define ASPEED_VUART_DEFAULT_SIRQ_POLARITY IRQ_TYPE_LEVEL_LOW + struct aspeed_vuart { struct device *dev; void __iomem *regs; @@ -393,7 +397,8 @@ static int aspeed_vuart_probe(struct platform_device *pdev) struct aspeed_vuart *vuart; struct device_node *np; struct resource *res; - u32 clk, prop; + u32 clk, prop, sirq[2]; + bool sirq_polarity; int rc; np = pdev->dev.of_node; @@ -501,6 +506,43 @@ static int aspeed_vuart_probe(struct platform_device *pdev) of_node_put(sirq_polarity_sense_args.np); } + rc = of_property_read_u32(np, "aspeed,lpc-address", &prop); + if (rc < 0) + prop = ASPEED_VUART_DEFAULT_LPC_ADDR; + + rc = aspeed_vuart_set_lpc_address(vuart, prop); + if (rc < 0) { + dev_err(&pdev->dev, "invalid value in aspeed,lpc-address property\n"); + goto err_clk_disable; + } + + rc = of_property_read_u32_array(np, "aspeed,sirq", sirq, 2); + if (rc < 0) { + sirq[0] = ASPEED_VUART_DEFAULT_SIRQ; + sirq[1] = ASPEED_VUART_DEFAULT_SIRQ_POLARITY; + } + + rc = aspeed_vuart_set_sirq(vuart, sirq[0]); + if (rc < 0) { + dev_err(&pdev->dev, "invalid sirq number in aspeed,sirq property\n"); + goto err_clk_disable; + } + + switch (sirq[1]) { + case IRQ_TYPE_LEVEL_LOW: + sirq_polarity = false; + break; + case IRQ_TYPE_LEVEL_HIGH: + sirq_polarity = true; + break; + default: + dev_err(&pdev->dev, "invalid sirq polarity in aspeed,sirq property\n"); + rc = -EINVAL; + goto err_clk_disable; + } + + aspeed_vuart_set_sirq_polarity(vuart, sirq_polarity); + aspeed_vuart_set_enabled(vuart, true); aspeed_vuart_set_host_tx_discard(vuart, true); platform_set_drvdata(pdev, vuart); From patchwork Fri Apr 2 00:47:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zev Weiss X-Patchwork-Id: 414805 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 19D27C43460 for ; Fri, 2 Apr 2021 00:47:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E746F61108 for ; Fri, 2 Apr 2021 00:47:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234069AbhDBAro (ORCPT ); Thu, 1 Apr 2021 20:47:44 -0400 Received: from thorn.bewilderbeest.net ([71.19.156.171]:36941 "EHLO thorn.bewilderbeest.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234029AbhDBArg (ORCPT ); Thu, 1 Apr 2021 20:47:36 -0400 Received: from hatter.bewilderbeest.net (unknown [IPv6:2600:6c44:7f:ba20::7c6]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: zev) by thorn.bewilderbeest.net (Postfix) with ESMTPSA id 3CEDFAE5; Thu, 1 Apr 2021 17:47:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bewilderbeest.net; s=thorn; t=1617324456; bh=mG1Dm2fW2UwoboBnU+wIfFXTMY9ejhypOdNwoGlLiJ0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JzRnOyxoFrgmrZpc90OW3tWruXxmmEeL2tIVxWU1Qh2TPsVmB03UcdGZFtj+uO+XU aViEnKHRLtefBzI7Su5d+tf8B82XRHJAtPz7mV7SaVtIPzYrVqonHoNDHXZ0YRSYQB 6OPt1iKp1UuYFqOVDPrAFH0O+OJmpGyhd5mWXNJ0= From: Zev Weiss To: Joel Stanley Cc: openbmc@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org, linux-kernel@vger.kernel.org, Andrew Jeffery , Zev Weiss , Greg Kroah-Hartman , Rob Herring , Lubomir Rintel , - , linux-serial@vger.kernel.org Subject: [PATCH v3 4/4] dt-bindings: serial: 8250: add aspeed, lpc-address and aspeed, sirq Date: Thu, 1 Apr 2021 19:47:16 -0500 Message-Id: <20210402004716.15961-5-zev@bewilderbeest.net> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210402004716.15961-1-zev@bewilderbeest.net> References: <20210402004716.15961-1-zev@bewilderbeest.net> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org These correspond to the existing lpc_address, sirq, and sirq_polarity sysfs attributes; the second element of aspeed,sirq provides a replacement for the deprecated aspeed,sirq-polarity-sense property. Signed-off-by: Zev Weiss --- .../devicetree/bindings/serial/8250.yaml | 27 ++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/Documentation/devicetree/bindings/serial/8250.yaml b/Documentation/devicetree/bindings/serial/8250.yaml index 491b9297432d..a6e01f9b745f 100644 --- a/Documentation/devicetree/bindings/serial/8250.yaml +++ b/Documentation/devicetree/bindings/serial/8250.yaml @@ -12,8 +12,13 @@ maintainers: allOf: - $ref: /schemas/serial.yaml# - if: - required: - - aspeed,sirq-polarity-sense + anyOf: + - required: + - aspeed,lpc-address + - required: + - aspeed,sirq + - required: + - aspeed,sirq-polarity-sense then: properties: compatible: @@ -190,6 +195,20 @@ properties: applicable to aspeed,ast2500-vuart. deprecated: true + aspeed,lpc-address: + $ref: '/schemas/types.yaml#/definitions/uint32' + description: | + The VUART LPC address. Only applicable to aspeed,ast2500-vuart. + + aspeed,sirq: + $ref: "/schemas/types.yaml#/definitions/uint32-array" + minItems: 2 + maxItems: 2 + description: | + A 2-cell property describing the VUART SIRQ number and SIRQ + polarity (IRQ_TYPE_LEVEL_LOW or IRQ_TYPE_LEVEL_HIGH). Only + applicable to aspeed,ast2500-vuart. + required: - reg - interrupts @@ -221,6 +240,7 @@ examples: }; - | #include + #include serial@1e787000 { compatible = "aspeed,ast2500-vuart"; reg = <0x1e787000 0x40>; @@ -228,7 +248,8 @@ examples: interrupts = <8>; clocks = <&syscon ASPEED_CLK_APB>; no-loopback-test; - aspeed,sirq-polarity-sense = <&syscon 0x70 25>; + aspeed,lpc-address = <0x3f8>; + aspeed,sirq = <4 IRQ_TYPE_LEVEL_LOW>; }; ...