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: 297007 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 73DE6C433E2 for ; Fri, 11 Sep 2020 09:39:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3B259221F1 for ; Fri, 11 Sep 2020 09:39:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="SsrdoWR2" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725781AbgIKJjl (ORCPT ); Fri, 11 Sep 2020 05:39:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36386 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725780AbgIKJjh (ORCPT ); Fri, 11 Sep 2020 05:39:37 -0400 Received: from mail-pj1-x1043.google.com (mail-pj1-x1043.google.com [IPv6:2607:f8b0:4864:20::1043]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 68AFCC061756 for ; Fri, 11 Sep 2020 02:39:36 -0700 (PDT) Received: by mail-pj1-x1043.google.com with SMTP id a9so1453592pjg.1 for ; Fri, 11 Sep 2020 02:39:36 -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=Q6WWHupQ9tOgzD4QyUNDvya77Cx4kDlStbid4z1QCnOvbCXwA1owpP0xL2PHvzCEK4 X1Vbo37cjq52XW5yQ8Ul0RxCBLls0ORlLmHs2qQ1Qgrh58P4Qrb7p3vuwhNjWpI+JzSz WU3TDRmnEqLHr2tOixxIBImAaafQB9k0x6KRlrHhXNNEblmcyXusb6GdQ1O0fHG6u+Bb ZTxF+ye4OGCHmE+ioH2s2M5ZpYitqKreEH7QpVVux5xDaZ03YNAbY2Qi85M9XC8IOmpW i2jlv44r2jogEWsJxO1GCU5erYDpKrxQ/gOJTohZdN6G6A3HsU3TNwlb51UePDkgllOT C8Tg== X-Gm-Message-State: AOAM533nA25MLQfjoJWv1gtSsP61ncq/QXPM1cFppcM8jRdquGpXbbnV 2o3EepX5hceRqNrwKIoQum1QyKFDGx3ed3pl 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 Cc: Greg Kroah-Hartman , Jiri Slaby , Matthias Brugger , Serge Semin , Changqi Hu , Frank Wunderlich , Hsin-Yi Wang , Andy Shevchenko , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, Enric Balletbo i Serra 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 Sender: linux-serial-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.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: 258059 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 00421C43461 for ; Fri, 11 Sep 2020 09:39:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B9BC521D92 for ; Fri, 11 Sep 2020 09:39:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="KfefxcN2" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725794AbgIKJjs (ORCPT ); Fri, 11 Sep 2020 05:39:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36420 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725793AbgIKJjr (ORCPT ); Fri, 11 Sep 2020 05:39:47 -0400 Received: from mail-pj1-x1044.google.com (mail-pj1-x1044.google.com [IPv6:2607:f8b0:4864:20::1044]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D88C7C061756 for ; Fri, 11 Sep 2020 02:39:46 -0700 (PDT) Received: by mail-pj1-x1044.google.com with SMTP id kk9so1433110pjb.2 for ; Fri, 11 Sep 2020 02:39:46 -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=qFueWEprS9cUmNZC9ZYCjJBJhvgo4z2BqyBT7VYj2CycMEqL8tXHkJE81XIC2YC1Ze ck+KVWq3TpVtGRRwx3ynKPviPH3RggEYkv5vmxN7WedZwrgUvlqaBPPadoxEuysT50yl scteb79squ05+Wp84IydPqXIHHYwuE7cpvkZAru5zY6mMzW0yMXzpA9M9QKY29VtjSF9 lUq9UrwvYig2IEyXia5qyXX5DGtM6YLAN2fNcgTQsaypMvv3Doa6CmaQ2u05xtmq0PHt EgGGRKyeTJE7YJoY9DFlHu7Ws5/x4OxK0DP8kmDf6JtQr3yYB7MrF+Yr9JgtFD0iJUcv us3w== X-Gm-Message-State: AOAM530ayTdTFT+1VBrPA4S1nBdqeGyVCvf1RgqoE9Y3EWDyD5yWW7cY 9iJxLglc84VOGvC3YTwpxqmQQX71C0BF/CRe 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 Cc: Greg Kroah-Hartman , Jiri Slaby , Matthias Brugger , Serge Semin , Changqi Hu , Frank Wunderlich , Hsin-Yi Wang , Andy Shevchenko , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, Enric Balletbo i Serra 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 Sender: linux-serial-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.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); }