From patchwork Mon Sep 13 06:02:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ChiaWei Wang X-Patchwork-Id: 12490057 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=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, 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 B2B04C433FE for ; Mon, 13 Sep 2021 16:34:36 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 82BCD60EE0 for ; Mon, 13 Sep 2021 16:34:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 82BCD60EE0 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=aspeedtech.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=zUI7X6RMmFQwUzJyQa7PfbdD/KyJ08GbSBUdzJ2eR3g=; b=DpEsA3bExpDO6V KHf7NETen/nlukz1DmLGl320rWM0WjMVi+NbKqKK/bpCypVZ3eT3lRGDEz/BiXLAM4JtQIRB6BXGh oev8u8jfsQPNEVhbi98PU7poJVlxHmw8FL6ytmqFYTg+y+2A1epVzg7C0v77Ha9ljWtHKO/3Jk2cQ aYipTO2FGQHxzd8ZCkSz0rOexrCXf7vsxX52lCHNEymLUW8vO7XU2OS4K5uaa8UWjqBEm6Wm4HhFj YZ91aahoakF+Tqosyvt0TtowqvUXRXn5hVsRdM2FE+rpMssuR79hq71ub64W2QWgSlPAvZZ1jNhqy 5FuDrddiLPMdCd2WTUTA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mPosr-002O7X-Uu; Mon, 13 Sep 2021 16:32:42 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mPosp-002O6z-2T for linux-arm-kernel@bombadil.infradead.org; Mon, 13 Sep 2021 16:32:39 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Type:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:CC:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=i3Z2kPopaxBRQ6u02CW0eVMClsuUQ+oziQxCCMCV1p0=; b=nDQUhXy3zUAAvjd30fCyNERD3f qbsa7azUE8e3TRRUdqsMzbEuzhDNfje4BiadBeWmeGmi2dm6SG4jOJqHOaTt4vpZPjW8a2H6K7o5J XFS7EnBhfVTeF7r8ILz8JF/lwl00ZFTXX5Me4qEceLXqgUbdFFyCEmGxwqo19iW0ZJCD+6V1zCrRG yh0Az2r+U2zJ/sRcAB/ym8Yes22y8won3whdZ18LW4FSnI4ej0au59dVMTNOsqBUEOoPyyL5HSRpj qBHXNR7uJQkqngNmjGhBw029YDfQqpzHI9XDAnPhNxyNnIW1XYHSRr9lTuJsMIvFdc3Witx8rFnWK QYgYWYbw==; Received: from twspam01.aspeedtech.com ([211.20.114.71]) by desiato.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mPf3R-002l5X-PY for linux-arm-kernel@lists.infradead.org; Mon, 13 Sep 2021 06:03:01 +0000 Received: from mail.aspeedtech.com ([192.168.0.24]) by twspam01.aspeedtech.com with ESMTP id 18D5gg91094965; Mon, 13 Sep 2021 13:42:44 +0800 (GMT-8) (envelope-from chiawei_wang@aspeedtech.com) Received: from ChiaWeiWang-PC.aspeed.com (192.168.2.66) by TWMBX02.aspeed.com (192.168.0.24) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 13 Sep 2021 14:02:27 +0800 From: Chia-Wei Wang To: , , , , , , , CC: , Subject: [PATCH v4 2/4] dt-bindings: aspeed: Add UART routing controller Date: Mon, 13 Sep 2021 14:02:29 +0800 Message-ID: <20210913060231.15619-3-chiawei_wang@aspeedtech.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210913060231.15619-1-chiawei_wang@aspeedtech.com> References: <20210913060231.15619-1-chiawei_wang@aspeedtech.com> MIME-Version: 1.0 X-Originating-IP: [192.168.2.66] X-ClientProxiedBy: TWMBX02.aspeed.com (192.168.0.24) To TWMBX02.aspeed.com (192.168.0.24) X-DNSRBL: X-MAIL: twspam01.aspeedtech.com 18D5gg91094965 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210913_070258_421854_F549C248 X-CRM114-Status: GOOD ( 18.14 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add dt-bindings for Aspeed UART routing controller. Signed-off-by: Oskar Senft Signed-off-by: Chia-Wei Wang --- .../devicetree/bindings/mfd/aspeed-lpc.yaml | 4 ++ .../bindings/soc/aspeed/uart-routing.yaml | 70 +++++++++++++++++++ 2 files changed, 74 insertions(+) create mode 100644 Documentation/devicetree/bindings/soc/aspeed/uart-routing.yaml diff --git a/Documentation/devicetree/bindings/mfd/aspeed-lpc.yaml b/Documentation/devicetree/bindings/mfd/aspeed-lpc.yaml index 4e3862cf2a4b..f9aa431127ee 100644 --- a/Documentation/devicetree/bindings/mfd/aspeed-lpc.yaml +++ b/Documentation/devicetree/bindings/mfd/aspeed-lpc.yaml @@ -142,6 +142,10 @@ patternProperties: - interrupts - snoop-ports + "^uart-routing@[0-9a-f]+$": + $ref: /schemas/soc/aspeed/uart-routing.yaml# + description: The UART routing control under LPC register space + required: - compatible - reg diff --git a/Documentation/devicetree/bindings/soc/aspeed/uart-routing.yaml b/Documentation/devicetree/bindings/soc/aspeed/uart-routing.yaml new file mode 100644 index 000000000000..534b2a9340ce --- /dev/null +++ b/Documentation/devicetree/bindings/soc/aspeed/uart-routing.yaml @@ -0,0 +1,70 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +# # Copyright (c) 2018 Google LLC +# # Copyright (c) 2021 Aspeed Technology Inc. +%YAML 1.2 +--- +$id: "http://devicetree.org/schemas/soc/aspeed/uart-routing.yaml#" +$schema: "http://devicetree.org/meta-schemas/core.yaml#" + +title: Aspeed UART Routing Controller + +maintainers: + - Oskar Senft + - Chia-Wei Wang + +description: + The Aspeed UART routing control allow to dynamically route the inputs for + the built-in UARTS and physical serial I/O ports. + + This allows, for example, to connect the output of UART to another UART. + This can be used to enable Host <-> BMC communication via UARTs, e.g. to + allow access to the Host's serial console. + + This driver is for the BMC side. The sysfs files allow the BMC userspace + which owns the system configuration policy, to configure how UARTs and + physical serial I/O ports are routed. + + Two types of files, uart* and io*, are presented in sysfs. The uart* + configures the input signal of a UART controller whereas io* configures + that of a physical serial port. + + When read, each file shows the list of available options with currently + selected option marked by brackets "[]". The list of available options + depends on the selected file. + + e.g. + cat /sys/bus/platform/drivers/aspeed-uart-routing/*.uart_routing/uart1 + [io1] io2 io3 io4 uart2 uart3 uart4 io6 + + In this case, UART1 gets its input from IO1 (physical serial port 1). + +properties: + compatible: + items: + - enum: + - aspeed,ast2400-uart-routing + - aspeed,ast2500-uart-routing + - aspeed,ast2600-uart-routing + reg: + maxItems: 1 + +required: + - compatible + +additionalProperties: false + +examples: + - | + lpc: lpc@1e789000 { + compatible = "aspeed,ast2600-lpc-v2", "simple-mfd", "syscon"; + reg = <0x1e789000 0x1000>; + + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x0 0x1e789000 0x1000>; + + uart_routing: uart-routing@98 { + compatible = "aspeed,ast2600-uart-routing"; + reg = <0x98 0x8>; + }; + };