From patchwork Tue Sep 15 05:48:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hsin-Yi Wang X-Patchwork-Id: 11775587 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 96274618 for ; Tue, 15 Sep 2020 05:48:51 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 2EB4B2080C for ; Tue, 15 Sep 2020 05:48:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="qyvAAn3k"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="d5fpZWid" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2EB4B2080C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.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=eM543gKTIcycnoT1APc1GtIvZM/ITYOVElwqGjgzSCA=; b=qyvAAn3k7ePX70189zXqWPynfC mA586KN0BC6YwJNTP2RDr+svraa+WRS9ngyBEsiQOiiaNg/ibsvSsiiW+U41xhzOJKP2hnZkn6K0Q lYKuqIbINyWL+yPAtJa7zktcQ0bGLAKjxYEamOl4/EnsXQGqmyVmX56ZlbisDNtLVoWkxdxrY1Ucf i7/b5dyCGIj1ihWj8FlfSIyykH1WKWBVuLi14t0wNEsivRKmaPAEUyMM46nArA92CE6AbzU1D2cXi +iJxhAt0m2rt+J8YvpI0ewqBZ8ez2rYsk81cddbHzxLRYdbGNREACAGic0RZA+VdjpoEAKHHTgcgP 7wupukSw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kI3pf-0003Dw-UJ; Tue, 15 Sep 2020 05:48:48 +0000 Received: from mail-pj1-x1034.google.com ([2607:f8b0:4864:20::1034]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kI3pb-0003Cu-Dq for linux-mediatek@lists.infradead.org; Tue, 15 Sep 2020 05:48:44 +0000 Received: by mail-pj1-x1034.google.com with SMTP id fa1so1196935pjb.0 for ; Mon, 14 Sep 2020 22:48:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=i6P44y5mpNfyLXR4RrG6FSEEHMj+iy7zvhbL9GfNdpo=; b=d5fpZWid3HK1S3xeIBo+ue3RwJcRvMaqXA2dL6Lr92GKstsooZcdMke7Fq8vsiRI41 Ey17Xc6tNlQNXNx0S2hxaCGnhuY2Y2OnpPjTzRXLub5w0N7X/JxbD8I82KLgzYJxivrl 68MOS1P2Q86+kcaiKUH9xAmW8eP9Z7oTe1e0M= 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=i6P44y5mpNfyLXR4RrG6FSEEHMj+iy7zvhbL9GfNdpo=; b=dTxNfHyd+m0KiF0pvGV1wb9gPHFuUt291yzm1ZURr2U9+xPHWGJALLZ4oc5HF9Q54L n17kT5ciUTNZGO/QL9cne7t3YzfKNejgXQ+WMjSYNHT7TukDKfke/tg0q7ib6JbwjZOF zt/U6FNiYNPQWUU/3QfXoaqjzbENj5M1t6WuVHo0dgVC9q1B0ODBS7ZyJrENA1IwRq0k NLfg9rQZ0XWXKrNV6dHF9gvMoBXb7zy6dl9ZPamI583bpwpHeak/Bgl2K1UYvZTlrPNm LK1rLI+ccw6St4vCDYMqScXx4s2vBFP6B/i0bG38TWxtH6mUpr4Ll9RLzrvwVWKSjVmc wYsA== X-Gm-Message-State: AOAM532WCWNiKXBdES/OTru6Uh3HRYc8IQ6X5/I54e9DBLYYjL7ZLAz+ FtUS9rqaT346K31VCw3Z+rh0bg== X-Google-Smtp-Source: ABdhPJyBoTpUYRjmNE7S4RH/HZ+Wd5QDHCdP+aOrKbrqlSzxhloY/EzG1bmXclaKkAnFOoA370xwVw== X-Received: by 2002:a17:902:b186:b029:d1:cc21:9a7d with SMTP id s6-20020a170902b186b02900d1cc219a7dmr6444831plr.8.1600148920854; Mon, 14 Sep 2020 22:48:40 -0700 (PDT) Received: from hsinyi-z840.tpe.corp.google.com ([2401:fa00:1:10:1a60:24ff:fe89:3e93]) by smtp.gmail.com with ESMTPSA id gn24sm11034935pjb.8.2020.09.14.22.48.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Sep 2020 22:48:40 -0700 (PDT) From: Hsin-Yi Wang To: linux-serial@vger.kernel.org Subject: [PATCH v2 1/2] tty: serial: print earlycon info after match->setup Date: Tue, 15 Sep 2020 13:48:25 +0800 Message-Id: <20200915054825.3289105-1-hsinyi@chromium.org> X-Mailer: git-send-email 2.28.0.618.gf4bc123cb7-goog MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200915_014843_513456_233F5867 X-CRM114-Status: GOOD ( 12.92 ) X-Spam-Score: -3.2 (---) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-3.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:1034 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -3.0 DKIMWL_WL_HIGH DKIMwl.org - Whitelisted High sender X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eddie Huang , Changqi Hu , Frank Wunderlich , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, Serge Semin , Enric Balletbo i Serra , linux-mediatek@lists.infradead.org, Hsin-Yi Wang , Matthias Brugger , Andy Shevchenko , Jiri Slaby , linux-arm-kernel@lists.infradead.org Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org 8250 devices may modify iotype in their own earlycon setup. For example: 8250_mtk and 8250_uniphier force iotype to be MMIO32. Print earlycon info after match->setup to reflect actual earlycon info. Signed-off-by: Hsin-Yi Wang --- Change: v1->v2: rename function --- drivers/tty/serial/earlycon.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/tty/serial/earlycon.c b/drivers/tty/serial/earlycon.c index 2ae9190b64bb9..b70877932d47d 100644 --- a/drivers/tty/serial/earlycon.c +++ b/drivers/tty/serial/earlycon.c @@ -56,7 +56,6 @@ static void __init earlycon_init(struct earlycon_device *device, const char *name) { struct console *earlycon = device->con; - struct uart_port *port = &device->port; const char *s; size_t len; @@ -70,6 +69,12 @@ static void __init earlycon_init(struct earlycon_device *device, len = s - name; strlcpy(earlycon->name, name, min(len + 1, sizeof(earlycon->name))); earlycon->data = &early_console_dev; +} + +static void __init earlycon_print_info(struct earlycon_device *device) +{ + struct console *earlycon = device->con; + struct uart_port *port = &device->port; if (port->iotype == UPIO_MEM || port->iotype == UPIO_MEM16 || port->iotype == UPIO_MEM32 || port->iotype == UPIO_MEM32BE) @@ -140,6 +145,7 @@ static int __init register_earlycon(char *buf, const struct earlycon_id *match) earlycon_init(&early_console_dev, match->name); err = match->setup(&early_console_dev, buf); + earlycon_print_info(&early_console_dev); if (err < 0) return err; if (!early_console_dev.con->write) @@ -302,6 +308,7 @@ int __init of_setup_earlycon(const struct earlycon_id *match, } earlycon_init(&early_console_dev, match->name); err = match->setup(&early_console_dev, options); + earlycon_print_info(&early_console_dev); if (err < 0) return err; if (!early_console_dev.con->write) From patchwork Tue Sep 15 05:48:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hsin-Yi Wang X-Patchwork-Id: 11775589 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1300A618 for ; Tue, 15 Sep 2020 05:48:59 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 D410D206C9 for ; Tue, 15 Sep 2020 05:48:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="yK7JZWmb"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="lhwF0mVE" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D410D206C9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: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:List-Owner; bh=wgUK6KJkoMzIAP4dZZUUkwRGkvOtxNXQFK+rJ5JYro0=; b=yK7JZWmbJIxUtKHK/tBy3FmHT hYDHJjmOvVe0II+hAX12UVd+Cery0IoxawSvcsGx0AAQ43p0YwOfG/HOYw9P0a652sFmaj94gV1zK UOisRb7tAMIjekzowoOkInbr3IItq4ZNNXm3eaJGwmqK23yQ3h5p/q8lb2Wrh5uh7nZGrcHzUsj46 S/cSzCaWP/Rxj6La/ErScJ+SmLAqIXCheQZuAc8YbXxop6bwu30zBQ8qPEEgZtAb7iJSj5mc3mxEV 4OGczpnEY4ueQt8U6ZiWznbACZ0ccXzU1nMGCcrx5rtI14ijX0od+S4JJw09vXX0msJcEh4s72zRA McwKHrIFQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kI3po-0003Fu-5B; Tue, 15 Sep 2020 05:48:56 +0000 Received: from mail-pg1-x542.google.com ([2607:f8b0:4864:20::542]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kI3pl-0003EP-0Z for linux-mediatek@lists.infradead.org; Tue, 15 Sep 2020 05:48:54 +0000 Received: by mail-pg1-x542.google.com with SMTP id t14so1371920pgl.10 for ; Mon, 14 Sep 2020 22:48:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ajoQueMBujUuw1C0JmEIu2PRwKxBFaE7by2u7sZoZh8=; b=lhwF0mVEGZ9J3xNUDzGy1qYVGT40a/VHeqrvRc0rB+l4kY17O5nWvmZ3KwXPwgYMoO +6HM2/5N/2OZUYKxr3mGw91wwiSlX5s+aNMBp3VtiHZO2jbVDTjA9IfBHKBAEWodac8z oe6uDZK42z6+D+5MJefG+sNmpqgWbe5D19vrI= 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=ajoQueMBujUuw1C0JmEIu2PRwKxBFaE7by2u7sZoZh8=; b=Pb7pLLNW82HNFOm0E+0OQzaQ57yS5o9tZ/BCt8CFJLYIV/5292NQ6zp4IpFbgOfG3y iExoMYPwUdaagPXT9MWsFRL85nAIeUV2LQxUs0nOwnmudgQ3SWY20gbzJEkN+6HyL5KV Q9KwOe0sHxAjrLSZ7dyd0d1w/92oUZREw2KWCRfYMGus6FuGyvZal6/jVWdIqhLVfSCG ymPT+I0c7MzHjawYk58ypkqgUapeypGN/oLpmvbdrGT3ZEyGQmCmrAEUZDbYzeLl1865 hh3yXHqhSOHeDpa+SdGFMHy6slAvvAFJkJLzI1SesJcvz3i7jb2Cyy7nUXBPDwHIVtqo EP9w== X-Gm-Message-State: AOAM530hwBh7w+2Z/JHBQC/1GpxlC73q2ZU8v9pIPvO+3KZTMv8D9OAG Yi3H9tRXzSUABrOWu8bRt0g9UA== X-Google-Smtp-Source: ABdhPJx0DAS8oOMzQIF5bJW2RhKW9+TgJutsnK0EusfXFCToH4RzyIAADhtvDYQNvLhwg1sFyQ8kyQ== X-Received: by 2002:a63:5d07:: with SMTP id r7mr620189pgb.440.1600148930542; Mon, 14 Sep 2020 22:48:50 -0700 (PDT) Received: from hsinyi-z840.tpe.corp.google.com ([2401:fa00:1:10:1a60:24ff:fe89:3e93]) by smtp.gmail.com with ESMTPSA id gn24sm11034935pjb.8.2020.09.14.22.48.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Sep 2020 22:48:50 -0700 (PDT) From: Hsin-Yi Wang To: linux-serial@vger.kernel.org Subject: [PATCH v2 2/2] tty: serial: 8250_mtk: set regshift for mmio32 Date: Tue, 15 Sep 2020 13:48:27 +0800 Message-Id: <20200915054825.3289105-2-hsinyi@chromium.org> X-Mailer: git-send-email 2.28.0.618.gf4bc123cb7-goog In-Reply-To: <20200915054825.3289105-1-hsinyi@chromium.org> References: <20200915054825.3289105-1-hsinyi@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200915_014853_303680_A737D3B3 X-CRM114-Status: GOOD ( 12.95 ) X-Spam-Score: -3.2 (---) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-3.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:542 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -3.0 DKIMWL_WL_HIGH DKIMwl.org - Whitelisted High sender X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eddie Huang , Changqi Hu , Frank Wunderlich , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, Serge Semin , Enric Balletbo i Serra , linux-mediatek@lists.infradead.org, Hsin-Yi Wang , Matthias Brugger , Andy Shevchenko , Jiri Slaby , linux-arm-kernel@lists.infradead.org Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org To use mmio32, we also need to set regshift. Signed-off-by: Hsin-Yi Wang --- Change: v1->v2: none --- drivers/tty/serial/8250/8250_mtk.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/tty/serial/8250/8250_mtk.c b/drivers/tty/serial/8250/8250_mtk.c index 7b0dec14c8b80..41f4120abdf29 100644 --- a/drivers/tty/serial/8250/8250_mtk.c +++ b/drivers/tty/serial/8250/8250_mtk.c @@ -669,6 +669,7 @@ static int __init early_mtk8250_setup(struct earlycon_device *device, return -ENODEV; device->port.iotype = UPIO_MEM32; + device->port.regshift = 2; return early_serial8250_setup(device, NULL); }