Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp3840137imm; Mon, 2 Jul 2018 06:32:45 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdoMwbU4e8Tsfl1vdxcU3nltKf9v5mLhPSr2VyUl+LyYkXsMLN0EHcM5JsXWwSalEkA6B/i X-Received: by 2002:a63:7d48:: with SMTP id m8-v6mr6079144pgn.0.1530538364942; Mon, 02 Jul 2018 06:32:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530538364; cv=none; d=google.com; s=arc-20160816; b=wPe+oehMIr+iUWE7nQ9aQCIizlkPF81LX+ht8ln0yv8wyrXsi9q/l6gci+/mPGAnNn wC/NhKWC7valJwhOjtZt1qIbhcZ/Id+Xd+sDDDM9ZLZT6Mn0f1pvL9L2+FgNEx3+Gmq9 lPcXl5wXvtbSJ+SaTz411wpL8TdKDyZqwD3wZdtAJRXqn+2Tm07HrbyXrbInAKEq4WsZ sX8GxqT9kCixDboa5nwHT7/jRcoBdIpyOnZq+/LyBvNLaEQyEIIhb3npWf7JrQ+Wd90w S8+Byobh78khypaiG+kR8FzVOlW/c6tF58wbhYpH6Igqo3oaLlUxZur4x+Md+7MeaHPS kxUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=SueobPzIV2TcShSVr14Hvt2CHFUARLFKcuiuNkePW04=; b=bLskBJ0YwW/YBagCsbi/BhTlfrTFwiklqgtpu5VwsNrHM5skj8pOSHPP9DoXabGIYU y5GqgDwCoPxhSBlFXyjpLdXSciGFZOTPjweXJIrA4CAqdA60T9wrsiYNch5ARoj/HHPS FX5bkjRk+bYDONr81rReym7EdMkuYnlWxkxOdcx8NVW72Z4CokrXOKhlEIouIfJEhdF1 qXuXtZtBbpTa/5qeyHasJFHU8JfuDFRGH8wcc30r//WcFo19w3A9jKAp7C2uQ8+R4qIr pyJ9PG2k5qqhJKlunRgltjmuVy7sfg+R9o+00LxPRl38vU69aNIxznYybFYUqCqVZg/q VEmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kapsi.fi header.s=20161220 header.b=xbetqVK5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u23-v6si17202646plk.487.2018.07.02.06.32.29; Mon, 02 Jul 2018 06:32:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kapsi.fi header.s=20161220 header.b=xbetqVK5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752075AbeGBNaQ (ORCPT + 99 others); Mon, 2 Jul 2018 09:30:16 -0400 Received: from mail.kapsi.fi ([91.232.154.25]:56697 "EHLO mail.kapsi.fi" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751279AbeGBNaN (ORCPT ); Mon, 2 Jul 2018 09:30:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=kapsi.fi; s=20161220; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To:Subject; bh=SueobPzIV2TcShSVr14Hvt2CHFUARLFKcuiuNkePW04=; b=xbetqVK57mKIQe5HTeks8Ly1n0jtW3pDoJm7or/FakvUwSBjXg0sXrWiesmNNleigIDo+x2cDdaT9nB93HF/243Xga9xyS7CARCQaNDMLTUF+Sj7Zq1J4nqVZNkrT8RPpMEY20dkGG61eLfCwdTzw+ngI9kkXoVI3etsLC2Ei4c4GW8/Z5BytbmHU9g+3v28Yj9QjAcjRlWxS5bm/0XdZTdoiDnVg5wGQ3eOdvcZAi84Z0c09EaY39QhHBs83Sq3BWLL8n3yDrbsfA1UWQhsFxTaeX10DI8CGtX6imuSQ95eM7V6OBTdNGJJP6ueQ+ChFxxpi2WPgPMSPgucM0wIUg==; Received: from [193.209.96.43] (helo=[10.21.26.144]) by mail.kapsi.fi with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1fZyu8-0004jJ-77; Mon, 02 Jul 2018 16:30:08 +0300 Subject: Re: [PATCH v3 6/8] serial: Add Tegra Combined UART driver To: Thierry Reding , Mikko Perttunen Cc: jassisinghbrar@gmail.com, gregkh@linuxfoundation.org, jonathanh@nvidia.com, devicetree@vger.kernel.org, linux-serial@vger.kernel.org, linux-tegra@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <20180702114033.15654-1-mperttunen@nvidia.com> <20180702114033.15654-7-mperttunen@nvidia.com> <20180702131851.GH13096@ulmo> From: Mikko Perttunen Message-ID: <50c4702b-3d59-e443-5075-c888f83a2615@kapsi.fi> Date: Mon, 2 Jul 2018 16:30:07 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180702131851.GH13096@ulmo> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 193.209.96.43 X-SA-Exim-Mail-From: cyndis@kapsi.fi X-SA-Exim-Scanned: No (on mail.kapsi.fi); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02.07.2018 16:18, Thierry Reding wrote: > On Mon, Jul 02, 2018 at 02:40:31PM +0300, Mikko Perttunen wrote: >> The Tegra Combined UART (TCU) is a mailbox-based mechanism that allows >> multiplexing multiple "virtual UARTs" into a single hardware serial >> port. The TCU is the primary serial port on Tegra194 devices. >> >> Add a TCU driver utilizing the mailbox framework, as the used mailboxes >> are part of Tegra HSP blocks that are already controlled by the Tegra >> HSP mailbox driver. >> >> Signed-off-by: Mikko Perttunen >> --- >> >> Notes: >> v2: >> - Removed (void) casts for unused variables. >> - Changed the uart_set_options() call to be on one line, even if its >> over 80 characters. >> - Added defines for magic numbers. >> - Style fixes. >> - Changed Kconfig entry to depend on the Tegra HSP driver instead of >> just the mailbox framework. >> >> v3: >> - Removed FLUSH bit, as it's unnecessary and slows down printing >> - Removed call to uart_set_options >> - Added mbox_free_channel calls to remove() >> >> drivers/tty/serial/Kconfig | 9 ++ >> drivers/tty/serial/Makefile | 1 + >> drivers/tty/serial/tegra-tcu.c | 291 +++++++++++++++++++++++++++++++++++++++ >> include/uapi/linux/serial_core.h | 3 + >> 4 files changed, 304 insertions(+) >> create mode 100644 drivers/tty/serial/tegra-tcu.c > > The driver looks good to me. But for my own understanding, is there some > way we can make use of the multiplexing? That is, could we add a > mechanism to have the driver filter out only a specific stream? Could we > also specify which stream to send data back to? What happens by default? > Which stream is data sent to? There is no multiplexing on the producer/device side (i.e. what this driver does). The mailbox specified in device tree specifies the stream we send stuff to. The mailboxes are per-CPU (we use the CCPLEX mailbox here), so it cannot really be changed. The consumer then sees the multiplexing in that it can receive from and transmit to all of the various CPUs in the system at the same time. AIUI there is also a secondary form of multiplexing where the outputs of different VMs can be multiplexed by the hypervisor, but I'm not very familiar with that. Mikko > > Thierry >