Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp5168356pxb; Mon, 15 Feb 2021 11:21:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJw8Eh9M5yp/TzjiD8DhGqOi0lYDgql8orVXOs+MO8MUFx3f4eQZjUyQJcjjubwd+YtDVERd X-Received: by 2002:a17:906:87c1:: with SMTP id zb1mr10823691ejb.389.1613416899463; Mon, 15 Feb 2021 11:21:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613416899; cv=none; d=google.com; s=arc-20160816; b=tcHk9qCc7QrhjnltjZHNa2uJAUn7W+jQ2lsTrok+DWI36JsWtXTH9HcfroZ1vlPRsF YBIWoup8HDpW0hqJ+6GgEANxspp9lgPUU36Tfl+85X7aDZ9LjOfCU6W+OuSVCVdoZ3IH 4fENP9sMGlyKtPdKOAr6eiPWyqMAvfrBeUEN+klbSj7b4VKNiFhxUspZY/+AEIbu5Vxe pbVRt0erdXdNREOa/ox9x+mH9qjMfNq2RWIzWQ/170vyoedQ/hiAMg5J9EnPLHP4Jie+ hJOQNford0/IbV+Z6CpOuyRdyszb6876s44jDLzbr8t8SnTA4ulaxdFN4Xrq6NMrXHaz vRog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=RnUuiLgVFPTZZUMQRfYlfI3qlm9oP70j4KEJYtmavWc=; b=GowaAjlGoY3oSNU4xO8lUJOkAAMyWboXuE/SW1Foxt/AN3BKJoFu69prnZ8DX8Z/yF J7NhdMtFK4TM9LJ2yE7t62iRF1BPK0Tj8mfkk814xdw7jPQUBwnHjxpLERBg+IV654m0 IEjOIrXrTJw9WAgXyVnQIAvljd+nk/h0Dw4qss4nvvLVup2Hv/7WiIyYl/jKmM7O1S/C 0uAB+Sj0/Lx2Whyzk3ct0qOoRpBdxoA1uWWgjvXheJ7KX0KxWcozhjHgPQKvj/ORBTuN vpqLUdEE9UyZT5cL+o6F/WkdcU7iRiKFAiryr3CJeRZhf5TkSQcPU/gGtxYWFMKuMAo/ iTFg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i26si13157543edu.267.2021.02.15.11.21.16; Mon, 15 Feb 2021 11:21:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230172AbhBOTSj (ORCPT + 99 others); Mon, 15 Feb 2021 14:18:39 -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-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