From mboxrd@z Thu Jan 1 00:00:00 1970 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=-14.0 required=3.0 tests=BAYES_00,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 E72EDC433E6 for ; Mon, 15 Feb 2021 19:18:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AC2B964E16 for ; Mon, 15 Feb 2021 19:18:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230433AbhBOTSl (ORCPT ); Mon, 15 Feb 2021 14:18:41 -0500 Received: from mail-wr1-f51.google.com ([209.85.221.51]:43982 "EHLO mail-wr1-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229764AbhBOTSd (ORCPT ); Mon, 15 Feb 2021 14:18:33 -0500 Received: by mail-wr1-f51.google.com with SMTP id n8so10253896wrm.10; Mon, 15 Feb 2021 11:18:16 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=RnUuiLgVFPTZZUMQRfYlfI3qlm9oP70j4KEJYtmavWc=; b=DeljH/i39giX+n3lOiBe8+FO3RfMr4H9VIa8ruRmDYYE+FM8MHi/KrRJTqC8edT506 9TxB5bAGN7CqHHE5Z3o44kiDJDPnK+PX6dySW+tSzzUv9mWpLRfy13wKvxZhS7LtnxTa nb2YkBWcOIQRMinQtcgzk1wgnwcz7lnTVoNjImcHRweFLv+mbV/wO9fH19vSRJBwGDd+ WmFtoFP5HiK4Wrx5ucLtdce/Wmuild9BfRPAuMljKipQWFwTpzEajtyzna3b6E00ydkz OVmRMf6Q5ThYEgRWIFYIbK0q9L1Jy3bqLE15mjQZPj8b810z40Sp9dwNTVaaLzzxhnkZ C3dA== X-Gm-Message-State: AOAM533YcGRqd+RbuqV5xzTUkyeE9QbrVprTR2XxKZ8bCmb6/11GDPgN ccUSdUvbAH6WwihOgO+hol8= X-Google-Smtp-Source: ABdhPJzfhGTniQs4SY6DZRV5BSwoQM07GAafV6qca9gl95yAcrEK36EThwQNbBoVq+JPYTJA1X9Vcg== X-Received: by 2002:a5d:6b42:: with SMTP id x2mr19619128wrw.117.1613416671312; Mon, 15 Feb 2021 11:17:51 -0800 (PST) Received: from kozik-lap (adsl-84-226-167-205.adslplus.ch. [84.226.167.205]) by smtp.googlemail.com with ESMTPSA id d15sm20505885wru.80.2021.02.15.11.17.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Feb 2021 11:17:50 -0800 (PST) Date: Mon, 15 Feb 2021 20:17:48 +0100 From: Krzysztof Kozlowski To: Hector Martin Cc: linux-arm-kernel@lists.infradead.org, Marc Zyngier , Rob Herring , Arnd Bergmann , Olof Johansson , Mark Kettenis , Tony Lindgren , Mohamed Mediouni , Stan Skowronek , Alexander Graf , Will Deacon , Linus Walleij , Mark Rutland , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Arnd Bergmann Subject: Re: [PATCH v2 23/25] tty: serial: samsung_tty: Add earlycon support for Apple UARTs Message-ID: <20210215191748.uhus2e6gclkwgjo5@kozik-lap> References: <20210215121713.57687-1-marcan@marcan.st> <20210215121713.57687-24-marcan@marcan.st> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210215121713.57687-24-marcan@marcan.st> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 15, 2021 at 09:17:11PM +0900, Hector Martin wrote: > Earlycon support is identical to S3C2410, but Apple SoCs also need > MMIO mapped as nGnRnE. This is handled generically for normal drivers > including the normal UART path here, but earlycon uses fixmap and > runs before that scaffolding is ready. > > Since this is the only case where we need this fix, it makes more > sense to do it here in the UART driver instead of introducing a > whole fdt nonposted-mmio resolver just for earlycon/fixmap. > > Suggested-by: Arnd Bergmann > Signed-off-by: Hector Martin > --- > drivers/tty/serial/samsung_tty.c | 17 +++++++++++++++++ > 1 file changed, 17 insertions(+) > > diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c > index e7ab0b9d89a7..00262f0e704b 100644 > --- a/drivers/tty/serial/samsung_tty.c > +++ b/drivers/tty/serial/samsung_tty.c > @@ -2988,6 +2988,23 @@ OF_EARLYCON_DECLARE(s5pv210, "samsung,s5pv210-uart", > s5pv210_early_console_setup); > OF_EARLYCON_DECLARE(exynos4210, "samsung,exynos4210-uart", > s5pv210_early_console_setup); > + > +/* Apple S5L */ > +static int __init apple_s5l_early_console_setup(struct earlycon_device *device, > + const char *opt) > +{ > + /* Close enough to S3C2410 for earlycon... */ > + device->port.private_data = &s3c2410_early_console_data; > + > +#ifdef CONFIG_ARM64 if IS_ENABLED() (unless it cannot be used due to missing symbol?) > + /* ... but we need to override the existing fixmap entry as nGnRnE */ > + __set_fixmap(FIX_EARLYCON_MEM_BASE, device->port.mapbase, > + __pgprot(PROT_DEVICE_nGnRnE)); > +#endif > + return samsung_early_console_setup(device, opt); Don't you need to handle the error code - set PROT_DEFAULT() or whatever was there before? Best regards, Krzysztof From mboxrd@z Thu Jan 1 00:00:00 1970 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=-14.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS 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 DE5E8C433E0 for ; Mon, 15 Feb 2021 19:19:02 +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 9032E64E13 for ; Mon, 15 Feb 2021 19:19:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9032E64E13 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.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:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=D9/noEOH6Ceaa0868VJzN2erZijAxlDghYPGYrsVb3k=; b=G1pSwTwpH64oRqeiEA/9frPup WISp5Sfkt39ddX0LM/kNJ3R/hyikvWdJh/h6vknxak0VNCqGGh/yIKZe4xm6dxGD1c4s5rZLBXw4M sdHEcatm+IIeElKtwDu4WmMxecbeRGlZD0xWvQ4c3GX1n4g1Tps+hDR7H4x9PoMR4vUKPYOgHWwYq h7atkDVC3kMI9VdJTkoSndlFghRhm4+WZ0LLbf+zjML2ltDpQ93Ij3b+X6umBF3FFQEr4iuTe0qcx dRAdl1jBB/YbtpavmwvwJRP1XU7cXSNbkQ/tENZjpEmTPHixggbLiYYvxW7s4a7hIfxo6exj3rzdM mPqZbVtsA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1lBjNb-0008Rl-61; Mon, 15 Feb 2021 19:17:55 +0000 Received: from mail-wr1-f54.google.com ([209.85.221.54]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1lBjNY-0008RA-GW for linux-arm-kernel@lists.infradead.org; Mon, 15 Feb 2021 19:17:53 +0000 Received: by mail-wr1-f54.google.com with SMTP id t15so10223462wrx.13 for ; Mon, 15 Feb 2021 11:17:52 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=RnUuiLgVFPTZZUMQRfYlfI3qlm9oP70j4KEJYtmavWc=; b=AlmNBiIr0hNyT6lPIZmlxBKWw+xZZF5zVDjuY0A3fuXZphyCEPMyvaIRltFP4XjD06 oRXOnk33/EGv7Wa0Lufc/guo7+Yhlax56snutep8XW2DdVbe2SffXFfyWdNojdvc43HZ vOllGDEPwkGoiCy5GrW7VFxFjESerCexhB7datQwrT51N9578FwpPo1iY82YBqjYRcco kgSV28iJ8L6TV5uMUIR/h8PvzEFQ06bw3qvWpl2/bqMNVheQb/2v079yRHdl4vuF2L6X yycPzaxlAk1VwLN4dr6Pv4FbMu1Zwta8G5wJFC4Zr85P97Rf9vrByamMkhbRVsQORULM ruWA== X-Gm-Message-State: AOAM530vjtx+E0s3u4c9lgfgSxzFB2VfnkKZk8EyhubHF+MKzsufbo4P b8d1kn17Yzj63QSmnrRB5aw= X-Google-Smtp-Source: ABdhPJzfhGTniQs4SY6DZRV5BSwoQM07GAafV6qca9gl95yAcrEK36EThwQNbBoVq+JPYTJA1X9Vcg== X-Received: by 2002:a5d:6b42:: with SMTP id x2mr19619128wrw.117.1613416671312; Mon, 15 Feb 2021 11:17:51 -0800 (PST) Received: from kozik-lap (adsl-84-226-167-205.adslplus.ch. [84.226.167.205]) by smtp.googlemail.com with ESMTPSA id d15sm20505885wru.80.2021.02.15.11.17.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Feb 2021 11:17:50 -0800 (PST) Date: Mon, 15 Feb 2021 20:17:48 +0100 From: Krzysztof Kozlowski To: Hector Martin Subject: Re: [PATCH v2 23/25] tty: serial: samsung_tty: Add earlycon support for Apple UARTs Message-ID: <20210215191748.uhus2e6gclkwgjo5@kozik-lap> References: <20210215121713.57687-1-marcan@marcan.st> <20210215121713.57687-24-marcan@marcan.st> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210215121713.57687-24-marcan@marcan.st> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210215_141752_559318_1ED1C303 X-CRM114-Status: GOOD ( 23.05 ) 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: Mark Rutland , Arnd Bergmann , Arnd Bergmann , Rob Herring , Tony Lindgren , Marc Zyngier , Linus Walleij , linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Alexander Graf , Olof Johansson , Mohamed Mediouni , Stan Skowronek , Will Deacon , linux-arm-kernel@lists.infradead.org, Mark Kettenis Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Feb 15, 2021 at 09:17:11PM +0900, Hector Martin wrote: > Earlycon support is identical to S3C2410, but Apple SoCs also need > MMIO mapped as nGnRnE. This is handled generically for normal drivers > including the normal UART path here, but earlycon uses fixmap and > runs before that scaffolding is ready. > > Since this is the only case where we need this fix, it makes more > sense to do it here in the UART driver instead of introducing a > whole fdt nonposted-mmio resolver just for earlycon/fixmap. > > Suggested-by: Arnd Bergmann > Signed-off-by: Hector Martin > --- > drivers/tty/serial/samsung_tty.c | 17 +++++++++++++++++ > 1 file changed, 17 insertions(+) > > diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c > index e7ab0b9d89a7..00262f0e704b 100644 > --- a/drivers/tty/serial/samsung_tty.c > +++ b/drivers/tty/serial/samsung_tty.c > @@ -2988,6 +2988,23 @@ OF_EARLYCON_DECLARE(s5pv210, "samsung,s5pv210-uart", > s5pv210_early_console_setup); > OF_EARLYCON_DECLARE(exynos4210, "samsung,exynos4210-uart", > s5pv210_early_console_setup); > + > +/* Apple S5L */ > +static int __init apple_s5l_early_console_setup(struct earlycon_device *device, > + const char *opt) > +{ > + /* Close enough to S3C2410 for earlycon... */ > + device->port.private_data = &s3c2410_early_console_data; > + > +#ifdef CONFIG_ARM64 if IS_ENABLED() (unless it cannot be used due to missing symbol?) > + /* ... but we need to override the existing fixmap entry as nGnRnE */ > + __set_fixmap(FIX_EARLYCON_MEM_BASE, device->port.mapbase, > + __pgprot(PROT_DEVICE_nGnRnE)); > +#endif > + return samsung_early_console_setup(device, opt); Don't you need to handle the error code - set PROT_DEFAULT() or whatever was there before? Best regards, Krzysztof _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel