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: 11775595 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 B03B26CA for ; Tue, 15 Sep 2020 05:50:25 +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 7F51E206C9 for ; Tue, 15 Sep 2020 05:50:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="yjFJveM3"; 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 7F51E206C9 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=3DI9YKg2aLU+0K3BcMGPn/kHGItYenXiiG724eMt4Eg=; b=yjFJveM36pqgHs2tJZm5AjroPy MIvesEOoRu7FuvW+MLa6On50oVv6d/yvA19ddn4wf11weut0Xd5YFsuYYHtdhvxKReLuqDjEn/1AF yhIjNVopM55/zqVlXi+C2lo3fHmonZaZEwNBrkADlneKkcxmYYBspKP3tD8KfaGCdNJiw0u9vAf83 BRSqjeiQBuUz5vLvq2W/lMRFizSkK7fjV4Ia4D7TJrmAwTb0vJEmMon+CtWYf3aOsCKwHuz+fPwDx sAzW9mVc8b8cqz6TX+cFy+XhXfoA2ncfQczpKun8Wd5mCD0HVXO+QETEy/89e3zAIYh0Y1GdBp4b1 oqpnApJg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kI3pe-0003De-2n; Tue, 15 Sep 2020 05:48:46 +0000 Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kI3pb-0003Ct-DM for linux-arm-kernel@lists.infradead.org; Tue, 15 Sep 2020 05:48:44 +0000 Received: by mail-pl1-x636.google.com with SMTP id bg9so755506plb.2 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=bfK6mhdkVeE5wdK64aGo0FSUHhkWuTxfptj3Qm5cqaFhLLX6QkkTge4hwoel9ISmx/ wc8G/QBce/MvE7e0ZTOdtUT4SSsF5Zdqn/M5kf4T7oJPXhHA7wH10c/nZn8bXjDz1mHA WkI+GwzIje98HeePQV1QBk5fqvaML/EGFbhZxoQbZdS2jao83OMyR4l1ci3rV8uc2kpb v+dTEyGiupP5mZ02JIY1FAC2fuV7SDiDXhj0oTw3XqQtlaz7bgcIklozjLDCRNyct9o3 hDqUr2rLniXPC7QzteAenCJd2dZV5tZOTsLbaqKsZKWx8DeTiD4dSLZ4pWRdKVaTEIwa tEUA== X-Gm-Message-State: AOAM5337Nx22pcnVaw6DoTVWsCNk2PhXtlYobWOudiYq3ub8d+/uj7g/ lvQjO7aQvwxF1I6b+DjR1HaC7Q== 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_513032_27BD98BA X-CRM114-Status: GOOD ( 14.52 ) 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:636 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-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: 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-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 --- 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: 11775593 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 D6D02618 for ; Tue, 15 Sep 2020 05:50:24 +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 9FF56206C9 for ; Tue, 15 Sep 2020 05:50:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="qwW+z4N1"; 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 9FF56206C9 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=Rtx7JJXvlrWGL2UG129vRani0Rld94L/5OaZhLhtuGc=; b=qwW+z4N10ZiUXmOnPXS6B5uNI pqoTRzJR+WfSngnbX7b51+bfP2x4ZAWVkAPY65y7EQuMUtRIcVQmwtihKH0GnA8NfNVkCoOL6yxZG 6ao9LpJdq5K+Zon2alLa6Z4hhCR1TvsrdzMUlQIEz3O5OfdlD3FAB/HtK0i3ILaNMbk/LuJxfy0Rx VqjgaJZXVjStkn2XiIkMJc1pmZ43bOdFkd7lX+DSl3axy3Q/znkgIEwRgZL4924LsQ5YcZXmXE8Sa QdNLlEFzgRa7pmwWjz51JoP8dTGCjxrgdjxduCde58bioaofZXwAqHfc4R5Hf4sHWdF3NBuHpnA2U mTt1R7fhg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kI3pq-0003GJ-7h; Tue, 15 Sep 2020 05:48:58 +0000 Received: from mail-pf1-x443.google.com ([2607:f8b0:4864:20::443]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kI3pk-0003EO-Rz for linux-arm-kernel@lists.infradead.org; Tue, 15 Sep 2020 05:48:54 +0000 Received: by mail-pf1-x443.google.com with SMTP id n14so1286724pff.6 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=NW/EH3QgnJjHa9MSGdyhhv+6iWKpFCbok41x6ccZlMizJdHJ7DeEhpR2YUSdwHB1uR 5ZRsHwtzyS+tE6Hev49NOvenHc4OY8JrMUcxnOmClNysjTVTqavuGpFJsW6a112ymdd/ qGInKj0HuzP9+wparwLyIVQ3EyIsApYxMpwJqC0/LOrQH216qFAS9RUVEtDslcP89TPD 5MnXP46eT1t1esZ2GHv01oH7PQkKKONTOxCA/ybtd2wZz6UnlC04BqLa+zMbPvJDtckQ D4saU6x4x+TdLfX0Ba0PYRC0b6zuhIG5hSMC4NKl2f4ebOD03rSX2JGAQ3BckqKz2+h6 Unow== X-Gm-Message-State: AOAM532IZqWKeQTTCnqFC7QARNNcaWmwZYYU6/hA9oW/4oPLWTXC06ps BbQQrlIAXM5sWstKRDsjIesSlw== 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_303527_D92803B1 X-CRM114-Status: GOOD ( 14.55 ) 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:443 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-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: 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-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 --- 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); }