Received: by 10.192.165.148 with SMTP id m20csp1191118imm; Sat, 5 May 2018 06:42:02 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqdsHPmOU2bx4EWPLBY3pqq6DNpKDOrL7U/4UGyKkoRV1gu8SDC2piRlVb4+QXlVJ0TqvQ+ X-Received: by 2002:a17:902:b585:: with SMTP id a5-v6mr4206697pls.53.1525527722495; Sat, 05 May 2018 06:42:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525527722; cv=none; d=google.com; s=arc-20160816; b=IXjKTh7EjwPB6dp3naovAXmx9dAwEPKEjv2GuBuBezP76dE13HC1CqFdvViOUs6S+M 5o1uJewfXle6DZguOUVgJUzbCqV/79D/CYBRltwYvk+IHu4Nk/nxYnW/iPrVPuvyeJjg v4TGoy8yhe8mps1ymWFCmZ6weWdQCf8KE2fMwpGnU+lSezHPkurPPa7YWR5+j7rfPo1p hsSaR6+AfbVRe12allaR3kSJIneNCpQysD8uTunUR1s6L0q8aG6CxQOTItcfeZXhMYJD Zp4EtmKPemDqVcvGoeddPEt8g9LVl2RCb0kXUwWgYMWMZBv2EdXGK//BhC3RgxuOxe8c i9Lg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version:arc-authentication-results; bh=mibVqWy8ZjJMxRP3y7GQAd0wFraQwbGKfq3DVjc5bvw=; b=x59y+Yy1+dEpb0V4WPrUmUR4dLmnQcz0AFnmlriBTTd3xUIkMAHHFkCKLt6P0LpkBS OdeUChntrKY+mc7WdEzGw22YJZIcjduE+MOo/VLWXcsHiyuNFwUg6e4YDGOFakIU1G7D NhkTg/iw7gsIaMP9r9QgBoV3TfOUgXaHoRZMafGvvdRZagTPiBqLcCaxKb3OgDplQPhT qwIRM0HekwxXwehcief49rBzCj0jTY9Fz0anD6hRMinyEDRJmV63CnerkoQclkk6rOAf lKXumS17XzVO4LfH2ba/eQrZOfJXWzQgeTeVAf2VOY4CzXfVnddDF9hcJFV4gUWuugUF iVQg== ARC-Authentication-Results: i=1; mx.google.com; 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 b12-v6si15722038plk.327.2018.05.05.06.41.35; Sat, 05 May 2018 06:42:02 -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; 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 S1751337AbeEENlZ (ORCPT + 99 others); Sat, 5 May 2018 09:41:25 -0400 Received: from fieber.vanmierlo.com ([84.243.197.177]:43597 "EHLO kerio9.vanmierlo.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751086AbeEENlX (ORCPT ); Sat, 5 May 2018 09:41:23 -0400 X-Greylist: delayed 1813 seconds by postgrey-1.27 at vger.kernel.org; Sat, 05 May 2018 09:41:23 EDT X-Footer: dmFubWllcmxvLmNvbQ== Received: from roundcube.vanmierlo.com ([192.168.37.37]) (authenticated user m.brock@vanmierlo.com) by kerio9.vanmierlo.com (Kerio Connect 9.2.5 patch 3) with ESMTPA; Sat, 5 May 2018 15:10:35 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Sat, 05 May 2018 15:10:35 +0200 From: Maarten Brock To: Michal Simek Cc: linux-kernel@vger.kernel.org, monstr@monstr.eu, gnomes@lxorguk.ukuu.org.uk, Alexander Graf , devicetree@vger.kernel.org, Jiri Slaby , Greg Kroah-Hartman , Rob Herring , linux-serial@vger.kernel.org, Frank Rowand , linux-arm-kernel@lists.infradead.org, linux-serial-owner@vger.kernel.org Subject: Re: [RFC PATCH 0/3] serial: uartps: Add run time support for more IPs than hardcoded 2 In-Reply-To: References: Message-ID: <1d3bc2082972bb1d4abc2c15db396257@vanmierlo.com> X-Sender: m.brock@vanmierlo.com User-Agent: Roundcube Webmail/1.3.3 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018-04-26 16:08, Michal Simek wrote: > Hi, > > this series is trying to address discussion I had with Alan in past > https://patchwork.kernel.org/patch/9738445/. > > It is moving uart_register_driver() to probe function like it is done > in > pl011 driver. > And also introducing new function for alias compatibility checking to > resolve cases where some IPs have alias and some of them not. > This case is detected in pl011_probe_dt_alias() but not properly > solved. > > Also keep status of free ids/minor numbers in bitmap to know what's the > next unallocated number. > > The same solution can be used in pl011, uart16550 and uartlite to > really > get unified kernel. > > Tested on these use cases: > Notes: > ff000000 is the first PS uart listed in dtsi > ff010000 is the second PS uart listed in dtsi > > Standard zcu102 setting > serial0 = &uart0; > serial1 = &uart1; > [ 0.196628] ff000000.serial: ttyPS0 at MMIO 0xff000000 (irq = 33, > base_baud = 6250000) is a xuartps > [ 0.642542] ff010000.serial: ttyPS1 at MMIO 0xff010000 (irq = 34, > base_baud = 6250000) is a xuartps > > Swapped zcu102 setting > serial0 = &uart1; > serial1 = &uart0; > [ 0.196472] ff000000.serial: ttyPS1 at MMIO 0xff000000 (irq = 33, > base_baud = 6250000) is a xuartps > [ 0.196824] ff010000.serial: ttyPS0 at MMIO 0xff010000 (irq = 34, > base_baud = 6250000) is a xuartps > > uart0 on alias higher then MAX uart ports > serial0 = &uart1; > serial200 = &uart0; > [ 0.176793] ff000000.serial: ttyPS200 at MMIO 0xff000000 (irq = 33, > base_baud = 6250000) is a xuartps > [ 0.177288] ff010000.serial: ttyPS0 at MMIO 0xff010000 (irq = 34, > base_baud = 6250000) is a xuartps > > Both uarts on higher aliases > serial1 = &uart1; > serial2 = &uart0; > [ 0.196470] ff000000.serial: ttyPS2 at MMIO 0xff000000 (irq = 33, > base_baud = 6250000) is a xuartps > [ 0.196823] ff010000.serial: ttyPS1 at MMIO 0xff010000 (irq = 34, > base_baud = 6250000) is a xuartps > > uart0 not listed but it is probed first that's why should be ttyPS0 but > there is uart1 via alias > serial0 = &uart1; > [ 0.176656] xuartps ff000000.serial: No serial alias passed. Using > the first free id > [ 0.176671] xuartps ff000000.serial: Validate id 0 > [ 0.176680] xuartps ff000000.serial: The empty id is 0 > [ 0.176692] xuartps ff000000.serial: ID 0 already taken - skipped > [ 0.176701] xuartps ff000000.serial: Validate id 1 > [ 0.176710] xuartps ff000000.serial: The empty id is 1 > [ 0.176719] xuartps ff000000.serial: Selected ID 1 allocation passed > [ 0.176760] ff000000.serial: ttyPS1 at MMIO 0xff000000 (irq = 33, > base_baud = 6250000) is a xuartps > [ 0.177104] ff010000.serial: ttyPS0 at MMIO 0xff010000 (irq = 34, > base_baud = 6250000) is a xuartps > > uart0 not listed but it is probed first that's why should be ttyPS0 > serial1 = &uart1; > [ 0.176661] xuartps ff000000.serial: No serial alias passed. Using > the first free id > [ 0.176676] xuartps ff000000.serial: Validate id 0 > [ 0.176686] xuartps ff000000.serial: The empty id is 0 > [ 0.176696] xuartps ff000000.serial: Selected ID 0 allocation passed > [ 0.176737] ff000000.serial: ttyPS0 at MMIO 0xff000000 (irq = 33, > base_baud = 6250000) is a xuartps > [ 0.177069] ff010000.serial: ttyPS1 at MMIO 0xff010000 (irq = 34, > base_baud = 6250000) is a xuartps > > uarts not listed in aliases list > [ 0.176673] xuartps ff000000.serial: No serial alias passed. Using > the first free id > [ 0.176687] xuartps ff000000.serial: Validate id 0 > [ 0.176697] xuartps ff000000.serial: The empty id is 0 > [ 0.176707] xuartps ff000000.serial: Selected ID 0 allocation passed > [ 0.176746] ff000000.serial: ttyPS0 at MMIO 0xff000000 (irq = 33, > base_baud = 6250000) is a xuartps > [ 0.177057] xuartps ff010000.serial: No serial alias passed. Using > the first free id > [ 0.177070] xuartps ff010000.serial: Validate id 0 > [ 0.177079] xuartps ff010000.serial: The empty id is 0 > [ 0.177089] xuartps ff010000.serial: Selected ID 0 allocation failed > [ 0.177098] xuartps ff010000.serial: Validate id 1 > [ 0.177107] xuartps ff010000.serial: The empty id is 1 > [ 0.177116] xuartps ff010000.serial: Selected ID 1 allocation passed > [ 0.177149] ff010000.serial: ttyPS1 at MMIO 0xff010000 (irq = 34, > base_baud = 6250000) is a xuartps > > Thanks, > Michal Hello Michal, How will this interact with ns16550 based UARTs? Can we have both /dev/ttyS0 and /dev/ttyPS0? Currently we can't unless we create *no* serialN alias for the ns16550. And there is no other means to lock the /dev/ttySx name to a device either. Or will the xuartps driver eventually use /dev/ttySx as well? Maarten