Message ID | 20181112151853.29289-1-thierry.reding@gmail.com (mailing list archive) |
---|---|
Headers | show
Return-Path: <linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org> Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 578F7139B for <patchwork-linux-arm@patchwork.kernel.org>; Mon, 12 Nov 2018 15:19:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 43F3929BF5 for <patchwork-linux-arm@patchwork.kernel.org>; Mon, 12 Nov 2018 15:19:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3764F29CC4; Mon, 12 Nov 2018 15:19:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id BA71E29BF5 for <patchwork-linux-arm@patchwork.kernel.org>; Mon, 12 Nov 2018 15:19:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=LoUQONAKYRQbXHPvQywSL/a0jrv5DRtSMB9AjYnuE7A=; b=V4GtzxNz5ma5LQ IJX3rx4JUYbl3BzFMMoVzd5FIcAbOKYs3Csc/hYVZ1WSdpnqHKYVsVNXATa+643ytNFVckAzybVa5 Y/O7A4A+KznZ2RTeIHBiA01BKQzq3j3/3560EkeBNFIutid84zm0XMWuRuVF9YvzQay9nO9GvR2oA CjK5+iL6N4Ak3HSRUcm5DfMXwPKsV2tE4MlxsaXjSqjRE3yT5em7JICOQm/i/stAIaMHc6oTyP2oc 38CtnHEq1O3j+ytU+dkHEKJ7pE4W4ATSdV4v/Pa9/Kcjm/4n4I+2PPbVA7t5mG0qOmyeQ75Gkz8ac uIyX4BTecC1dsQwMkN+Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gMDza-0005bf-Kv; Mon, 12 Nov 2018 15:19:10 +0000 Received: from mail-ed1-x544.google.com ([2a00:1450:4864:20::544]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gMDzY-0005ZV-3J for linux-arm-kernel@lists.infradead.org; Mon, 12 Nov 2018 15:19:09 +0000 Received: by mail-ed1-x544.google.com with SMTP id d39so4387162edb.12 for <linux-arm-kernel@lists.infradead.org>; Mon, 12 Nov 2018 07:18:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=NniAZnfve9XGCyEKPs2LfdtfMVXw1NBBYFVqaU1e8OU=; b=LXE5z4cjiToJZ8ehRAFeJlQCdLLkJU7Vwu7FGpbw3qBEuNM/0nI1oAgjXAQtromGbq BhGVUqo1U8Ba0xxbTi0T6Q6LuHKNpyDyeFOILjROpNn3W+rJMZ8IWsCJYWH9GOT72RBw umvmnl3AR3LVAmjLZoK4CgIpLGTxlBxoyeFSGTbkYDc+OZ06+K3s9ZN4uH4yDFuZ8FMy ZwFKA0Eq3eKoMSAAFMQpj4VzFkeMzy8RQSu5lf9THenqEGRYJAoUYyTy0wHbCQ+aJPok kf7UxgxD0lbV9EfFFqe2/Bod7YLLtqEmsLpE5KTfD0klbyMlN4FRcZ0LrwAQgBAluQkP 9YCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=NniAZnfve9XGCyEKPs2LfdtfMVXw1NBBYFVqaU1e8OU=; b=PTQrfcbtDPzxHEY2NFN+qBwViGLSfK3gw+n+ISS++9pDg1zZvbBlaR8zbe7aaDwO7V 1ULzwOppiyY+//RU5xoydvNkdchwccaApEu6lA7nGdacEdGQh7bdx6TGzgoUrABWIvXi A86H95wwbDTz4eoLVZW+NvmcXDjqY+rAXuKcewunsl39BneqeY+hcGu8+EH//j/S0HnG v/uY//B+9RY11JLGHoyRjp999FApDQu1j7gY1CWoC2+zytQ58aNeF7YxWA8A6VEEvK+A yZe2HpRqFbmiZ4QTBFLSgqFoSm2EkiiNT8/zhE46kswuav08xHNN5h3lHc0m6cMh9t3V spLg== X-Gm-Message-State: AGRZ1gIxgcIBjeBtR2RjQxsVutPPXyl4f18oIlBciQ/XM1OaXrZCiLZr 5a3BVFM33ixH4oVsryjeYCk= X-Google-Smtp-Source: AJdET5eP+XIc/BBKeH+D4A/9kSl+2CMY/YFBqGO+6FwBrnL+/1Y2Jp/BrRqgHyBvhux6tfZMexL/fw== X-Received: by 2002:a17:906:a301:: with SMTP id j1-v6mr9776447ejz.188.1542035935409; Mon, 12 Nov 2018 07:18:55 -0800 (PST) Received: from localhost (pD9E511F8.dip0.t-ipconnect.de. [217.229.17.248]) by smtp.gmail.com with ESMTPSA id x3-v6sm4104161eda.20.2018.11.12.07.18.54 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 12 Nov 2018 07:18:54 -0800 (PST) From: Thierry Reding <thierry.reding@gmail.com> To: Thierry Reding <thierry.reding@gmail.com>, Jassi Brar <jassisinghbrar@gmail.com>, Greg Kroah-Hartman <gregkh@linuxfoundation.org> Subject: [PATCH v2 00/10] serial: Add Tegra Combined UART driver Date: Mon, 12 Nov 2018 16:18:43 +0100 Message-Id: <20181112151853.29289-1-thierry.reding@gmail.com> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181112_071908_138969_2B523105 X-CRM114-Status: GOOD ( 19.53 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Cc: devicetree@vger.kernel.org, Mika Liljeberg <mliljeberg@nvidia.com>, Mikko Perttunen <mperttunen@nvidia.com>, Timo Alho <talho@nvidia.com>, linux-serial@vger.kernel.org, Jiri Slaby <jslaby@suse.com>, linux-tegra@vger.kernel.org, Pekka Pessi <ppessi@nvidia.com>, Jon Hunter <jonathanh@nvidia.com>, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP |
Series |
serial: Add Tegra Combined UART driver
|
expand
|
From: Thierry Reding <treding@nvidia.com> Hi everyone, this is a reworked version of Mikko's earlier proposal[0]. I've reworked the TCU driver itself so that it relies less on global variables as well as added a Kconfig option to allow the console support to be selected. I also fixed a couple of issues that manifested themselves as I was moving towards the IRQ driven mode (TCU was passing a pointer to a local variable which was getting stored in the mailbox's ring buffer and the data pointed at was becoming stale by the time the mailbox got around to dequeue it). The biggest bulk of the changes is in the mailbox driver. This series addresses all of Jassi's comments from back at the time. One notable additional change is that shared mailboxes are now interrupt driven, which removes the need for polling mode. Unfortunately there is still an issue because the TCU uses the mailbox in atomic context for both TTY and console modes, so we get a sleeping- while-atomic BUG when using mbox_client->tx_block = true in order to rate-limit mbox_send_message(). In order to work around this, I added a mechanism to mbox_send_message() that will allow blocking from atomic context if the mailbox controller implements the new ->flush() callback. For Tegra HSP shared mailboxes this is done by spinning on the shared mailbox register until the receiver has marked the mailbox as empty. I have been running this locally for a couple of days now and it works perfectly. Furthermore this series incorporates Mikko's work in progress on splitting up the mailbox controllers and allowing multiple controllers to match on the same device tree node during mbox_request_channel(). Last but not least there are no build-time dependencies between the mailbox and serial drivers, so I think the easiest way to merge this is if Jassi picks up patches 1-5, Greg takes patches 6 & 7 and I pick up patches 8-10 into the Tegra tree. Changes in v2: - address all of Pekka's comments regarding shared interrupts, registers that don't exist on Tegra186 and shared mailbox directionality - add a patch to enable the TCU in the 64-bit ARM default configuration Thanks, Thierry [0]: https://lore.kernel.org/patchwork/project/lkml/list/?series=357641 Mikko Perttunen (5): mailbox: Allow multiple controllers per device dt-bindings: tegra186-hsp: Add shared mailboxes dt-bindings: serial: Add bindings for nvidia,tegra194-tcu arm64: tegra: Add nodes for TCU on Tegra194 arm64: tegra: Mark TCU as primary serial port on Tegra194 P2888 Thierry Reding (5): mailbox: Support blocking transfers in atomic context mailbox: tegra-hsp: Add support for shared mailboxes mailbox: tegra-hsp: Add suspend/resume support serial: Add Tegra Combined UART driver arm64: defconfig: Enable Tegra TCU .../bindings/mailbox/nvidia,tegra186-hsp.txt | 30 +- .../bindings/serial/nvidia,tegra194-tcu.txt | 35 ++ .../arm64/boot/dts/nvidia/tegra194-p2888.dtsi | 2 +- arch/arm64/boot/dts/nvidia/tegra194.dtsi | 38 +- arch/arm64/configs/defconfig | 1 + drivers/mailbox/mailbox.c | 11 +- drivers/mailbox/tegra-hsp.c | 517 +++++++++++++++--- drivers/tty/serial/Kconfig | 22 + drivers/tty/serial/Makefile | 1 + drivers/tty/serial/tegra-tcu.c | 299 ++++++++++ include/dt-bindings/mailbox/tegra186-hsp.h | 11 + include/linux/mailbox_controller.h | 4 + include/uapi/linux/serial_core.h | 3 + 13 files changed, 903 insertions(+), 71 deletions(-) create mode 100644 Documentation/devicetree/bindings/serial/nvidia,tegra194-tcu.txt create mode 100644 drivers/tty/serial/tegra-tcu.c