From patchwork Fri Sep 11 09:39:26 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: 11770079 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 0A7D01580 for ; Fri, 11 Sep 2020 09:41:04 +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 C44DF21D40 for ; Fri, 11 Sep 2020 09:41:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="S1mjqwX5"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="SsrdoWR2" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C44DF21D40 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-arm-kernel-bounces+patchwork-linux-arm=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=flEZx75CmxaueH9g8YhdW/HuxFQ5RteUGiYBuDXZtn8=; b=S1mjqwX5/rGglhtnODiIQ042yU uxntTgVe8u5fd57Ta5BTDRjjq9YMF6qwDr64M6DS14LFEH9WRZtFMb1FX+ywLRdxhmhxawIK51yKi bRauT2CKXz1YeNqPgRKFM5F0gCENAwUoOjM/MLgVEr51U0zmxEmxH9hjq0j7JcX7AELyA9gLTjIP8 3RPPudfZK6oIQmLUvt18lou8EExHg8+mNzdA6I0/+KwVauzkQyip3mM9DocpEO4owK/r5domW0kuJ W0swSgtZYtdaMMa7s5Pl7rMpKy48lv8uHqMaMHy1Hecuend25oIBhHCjj9nNMcfv0g6SmFRPcInvn tMwHFLUA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kGfX0-0004Ve-6w; Fri, 11 Sep 2020 09:39:46 +0000 Received: from mail-pj1-x1043.google.com ([2607:f8b0:4864:20::1043]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kGfWu-0004Sd-Ja for linux-arm-kernel@lists.infradead.org; Fri, 11 Sep 2020 09:39:42 +0000 Received: by mail-pj1-x1043.google.com with SMTP id u3so1430662pjr.3 for ; Fri, 11 Sep 2020 02:39:37 -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=rOvkQbHcqdEEW6imcqo512VuspBp3Sjb9vemZ7YeXi8=; b=SsrdoWR2xJuerEVchmJHs77EJDNTQwhJJ3BSD7dyycqxfJRgwEXXeZLoufITYzxwdf KubMausaC28CReuRTTMNmIOWAOttM0CgeQmKXPHCPJI389V06KhtJx8/5NJYJa9b7l4m 5HXcxWMAP0vD3X1sXf+tvQ2B3z34erifCxIDc= 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=rOvkQbHcqdEEW6imcqo512VuspBp3Sjb9vemZ7YeXi8=; b=UVKHhfA42OboPYQXZBdis2chI4iHSLAEQ3Ko41GyCUTC5oT2lgpzWcRzfi8gxDVDE2 CtCH4ppHcSF6KqFmcgTlHWs6spxPPPjvAeBRgyxzegO3gS0voO8d6oO3cUaIZhUWRqSU b9uglL67rtyw8kCQDL61E6sLnj9UjtbsexFd1nkxDfpkjzV6pxh0y18K9k+U4+dEn3e+ CH6/I5psNJ92YIvMfXLMgF9wstbXMcVLV49oIPWdOxIhi/sDt6f8ciYiMmUgcx2/mLZt tUiu/Q6z4W9U0dUvyRh2XY+TPtuYbYeHCQzTY/p6VvRqTYiuFY5oI0gxTjZaKX3E77dH iFFQ== X-Gm-Message-State: AOAM533e2Vy1qoXDfGofgGFQfMhFZBKsPTMPG2ACA1smc5WBuqi0YZw9 YTSQjCjua47q4t/O90fgOqXuHw== X-Google-Smtp-Source: ABdhPJwmX6yZWnZDIEx+xL+1xsLKAJsdIGcvlBqJnTBWOdo/WI0JBf49uctm86uYeq7xvEW3CgA8Qg== X-Received: by 2002:a17:90a:2ec8:: with SMTP id h8mr1461759pjs.173.1599817175625; Fri, 11 Sep 2020 02:39:35 -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 v1sm1433465pjh.16.2020.09.11.02.39.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Sep 2020 02:39:34 -0700 (PDT) From: Hsin-Yi Wang To: linux-serial@vger.kernel.org Subject: [PATCH 1/2] tty: serial: print earlycon info after match->setup Date: Fri, 11 Sep 2020 17:39:26 +0800 Message-Id: <20200911093927.608024-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-20200911_053940_764156_A10503DC X-CRM114-Status: GOOD ( 14.29 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.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:1043 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_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 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_AU Message has a valid DKIM or DK signature from author's domain -0.0 DKIMWL_WL_HIGH DKIMwl.org - Whitelisted High sender X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 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-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=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 --- 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..22f0876f72d49 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_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_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_info(&early_console_dev); if (err < 0) return err; if (!early_console_dev.con->write) From patchwork Fri Sep 11 09:39:28 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: 11770081 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 62F6E59D for ; Fri, 11 Sep 2020 09:41:11 +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 2C5B921D40 for ; Fri, 11 Sep 2020 09:41:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="fILdfCGs"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="KfefxcN2" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2C5B921D40 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-arm-kernel-bounces+patchwork-linux-arm=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=97QcFu7CyHX0KJe020t+BZx7mz7+L50GpjGY7A9/q28=; b=fILdfCGsh8z3vcPBT0q3vG6LT 5lNfeIRvSnMqE803duRvf6IrztF1abh+ET8XuksnLSiVLuQg0vkihgHEbntBZYZN33+sznmJwejyt 6z2msVVca6BrlWFv7Qt+7JhiIs6LJkMw9wnF8FnkNNQXNxoKxycx4d5KE536H08iK1TtZr6Brq0oR Xm2BxchrlminHdZiq9L7GCSSfi2nDUw+ZFM0uuUnov3Nop0ZYUn+X16J0w1eVxPcg+yCEIMP3HKUw SxOTLr7uHR3W+IPoOzv/l+ToHJC7vbnlt9i3pZTL0BVfN3zsZpRDovkc2stZ0zecpnPZHO1UBjkI4 YCvfPhLhQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kGfX9-0004ZZ-3d; Fri, 11 Sep 2020 09:39:55 +0000 Received: from mail-pj1-x1041.google.com ([2607:f8b0:4864:20::1041]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kGfX3-0004WV-4X for linux-arm-kernel@lists.infradead.org; Fri, 11 Sep 2020 09:39:51 +0000 Received: by mail-pj1-x1041.google.com with SMTP id v14so111602pjd.4 for ; Fri, 11 Sep 2020 02:39:47 -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=KlLBYhev4Wfr30ELlYvsH52U84dkhIKc99s8OuU9b24=; b=KfefxcN2qmiKm7hShLw/DbW+tGavlLL9yPgswsVnIa1mZF/9xadoxJtaLstqBG2QQI 2iFp2DEEFEOgr8UqwKZiS5kZav4nfauaqhjHUupxkrZEWPSo9XbX0QeAuvFGhY9v6k2O 1c5fG89iT8bZxJpCepC3R2wbgtrXNTUGFSGhU= 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=KlLBYhev4Wfr30ELlYvsH52U84dkhIKc99s8OuU9b24=; b=S4hQTWfZfjrOz1Yvf+v0GtFNmRyMJ2GoCUPy06hLEvILRlyFhGeqHlFOOOL3+IzBry g7ne7/TdliyCxJ2hWL0M/BRauojOVCWh8ly1yGshJ778R/utBDJgSWsiXMielCMShuaZ jr64RksWHdFDTy1uXHW3/oy0vClP17zCoFZtq7FABKVWxyMBwpfAeOcgpd3A5SgHylPH yLmcNreBRwljl/ZoqMNN1IxFKMXRKWjift0ZoSjThzqY5sxtdaaPMlQ0UJt7nyN/Hz+D AIaSM66nrWO3RB/FQIDUMfVOCNXVD2l7IoFq+RVeAkcsYSIVtF2HDG+PvT0F+Xwjllej IVzg== X-Gm-Message-State: AOAM531WNkFBjNQVQnp3ZESmyhlhD6JeLE0GHyAQcdAMTcDLw5ZlKkdI QPy2chOCUV2bZ6PbLSpEpkAS/g== X-Google-Smtp-Source: ABdhPJwI8ziC5/OM7tf5UKEvZbcS15PybCTYMTPLwIM6mRVaAnhqXfsGqJWqnsxQyXN/ZYuTJY7BoA== X-Received: by 2002:a17:90a:184:: with SMTP id 4mr1482988pjc.148.1599817186148; Fri, 11 Sep 2020 02:39:46 -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 v1sm1433465pjh.16.2020.09.11.02.39.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Sep 2020 02:39:45 -0700 (PDT) From: Hsin-Yi Wang To: linux-serial@vger.kernel.org Subject: [PATCH 2/2] tty: serial: 8250_mtk: set regshift for mmio32 Date: Fri, 11 Sep 2020 17:39:28 +0800 Message-Id: <20200911093927.608024-2-hsinyi@chromium.org> X-Mailer: git-send-email 2.28.0.618.gf4bc123cb7-goog In-Reply-To: <20200911093927.608024-1-hsinyi@chromium.org> References: <20200911093927.608024-1-hsinyi@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200911_053949_275719_18A47119 X-CRM114-Status: GOOD ( 13.93 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.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:1041 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_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 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_AU Message has a valid DKIM or DK signature from author's domain -0.0 DKIMWL_WL_HIGH DKIMwl.org - Whitelisted High sender X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 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-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org To use mmio32, we also need to set regshift. Signed-off-by: Hsin-Yi Wang --- 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); }