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: 11770075 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 1571E139F for ; Fri, 11 Sep 2020 09:39:47 +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 ACD4D21D92 for ; Fri, 11 Sep 2020 09:39:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="HsD6uvKl"; 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 ACD4D21D92 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=PZXUR/qvRpc9BvJ7myAhCbyg0LCkYnEU3aSrtCGPRwQ=; b=HsD6uvKl6mN9RunSODpU4vd698 JTv1y1ESV2TtrAFGDCbzd9/Gj6o8a5g9REZO02fRYF7feiC+HHpQO8btRWVWbHBnX/FEGlRA3U5iQ Kg89XBEu2CjIaIQmFAD4LyXZ+oZIyhZe7buAXqkR0xxX7DV6onVMIJLv6s51NxKjx8iYpSFZPDx4k Q2gQ0JhGnyJ55XxUIHX3MkifkQitiRY4l6fi/ySE+mCKuquJra2IHbSQXe9DWGPmvnISSqJyn/uQ9 Geo0yuemY+/Bl8ZyzbUsdV7vYzM6lIdDRYoq5DoP0b8taE+HL1jJEBRoWu0M04t3YhUqICDWQ4Iih bTnYH9ZA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kGfWy-0004VJ-7c; Fri, 11 Sep 2020 09:39:44 +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-0004Se-L8 for linux-mediatek@lists.infradead.org; Fri, 11 Sep 2020 09:39:42 +0000 Received: by mail-pj1-x1043.google.com with SMTP id b17so1439060pji.1 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=HoDnzeUDbzeIWHBNwFdK5l+Xlh6A6t2PL5A8lvYeEtw4cQOIfmEKo4U0ZDCmWS/KzQ XfGiGXUZFwivxZpYdoUjcW+KWqI9vf6ZHfFG8ZNHst89T6kOiawvARYixwF4K6kjkJDs WTNAgRtlZ7WVhw2+GUrCPco2WD95sx8A1FpHqjUq6EaI6K+OHcCTlmC3zzRqMXvSAnE3 j3WuG5MkW7Y/64qudl+2dup1HG3OdM+1u+NarlaF/TUFCJUGgP+tcodynpTc69yFbDQk JbZWjt4wbtdJnawIuTwg92unXLJu9M7pVehIAk+9yXYwvHBDF+jB+nIXhegktqDay3Ij bsnQ== X-Gm-Message-State: AOAM531JP0LJZp5e5ZTHoYCZ3hDyVWMgrge4d8iVTUdetN3/oXESpDh0 IKjFwMVllcs7iq6pbjdkLrKM7g== 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_763150_900612B9 X-CRM114-Status: GOOD ( 12.77 ) 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-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: 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 --- 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: 11770077 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 351DF59D for ; Fri, 11 Sep 2020 09:39:56 +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 04EE022204 for ; Fri, 11 Sep 2020 09:39:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="PcZKxvdx"; 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 04EE022204 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=xZevAA6TewtEkKHmMU6hPGqsu7rUL2p7jHTruUKHQ48=; b=PcZKxvdxnapQZp0nilCdKVMva 2RPqjOgMajehzqEKtaeaDsdpsf6Cz52MzZ6818ty1CH7094n2h10N4yCnVVjRXnvB7k0EY2YdGOt0 0JxWDsfq3kKdBOiNTdSQ7kKscOZTpmJ9j2KB5VcwDDtZ1pob0JschNLvxNy9qeC5r3ngIy5GluqXs GDRA36Ps/SJfGKI7fG9jbYfh3gLg1Jt/bXniH5uvkxNN2WwrM4ndLXgsd7ZFaiNSakKUfT9Xe/RM2 k9c4s3NRSDKKYhh/xav4+WJe0XvVmoKjKSkT6MI98HhvTS3E89xDjmH00hOD3cnRWComNZjAG0Mfj 5ElC8FA0w==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kGfX7-0004ZG-9b; Fri, 11 Sep 2020 09:39:53 +0000 Received: from mail-pj1-x1042.google.com ([2607:f8b0:4864:20::1042]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kGfX2-0004WU-T4 for linux-mediatek@lists.infradead.org; Fri, 11 Sep 2020 09:39:51 +0000 Received: by mail-pj1-x1042.google.com with SMTP id b17so1439247pji.1 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=Dl+K+8sMB6mnsFtiTFced8qygPTLVm0r4P2osTviqT7QeDVuyDM8uVxUnnOcyxEsH5 /2z1q57kuunRODC9lP4gXHeNWZ3xr0t7ioi5NDXZ8epB8pxnvUMelq3vJ6x20Ur6X7OS QmRaa8v/lnoUVkru5HZddRlF306JC4AqCiBn2JVt2ukkcfTuaoGL4W6n90KTIrSEIRgd 84uyti+qnrSxoJkeHE4TxMPn92hqIDJ53g08OuU122QA0ONAvZ8G4IU+YcTTSyOT+0/q 3YxlJ6GEf1abQkiR1YsR113gF1HkxdF2y1NaAjZsx6jOl1BeNfKfiaKDa057EuW4aetA 8MTA== X-Gm-Message-State: AOAM530b0Eyj25i5bHEGO4j1r6aryJCRgPsP8W2GG5ATrSuj87rKU8Pu D/nMwXX0Uvo5gqNoksygxMyzHQ== 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_053948_994180_59FB8638 X-CRM114-Status: GOOD ( 12.44 ) 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:1042 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-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: 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 --- 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); }