Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp4899305pxb; Mon, 15 Feb 2021 04:25:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJw4tFMf+Mw0vKmvjHka7IxcRsIO9DVobjBItsA1lITOUcQzkKeqoos0Gn2+8lqw9x2rF9xn X-Received: by 2002:a17:906:2b56:: with SMTP id b22mr4843548ejg.158.1613391951246; Mon, 15 Feb 2021 04:25:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613391951; cv=none; d=google.com; s=arc-20160816; b=gMIuEC/iKtgARcEr/XMTm/Oc4EPWoI/ZgsqDJf528pcXfVgGVpC73m9+VcgkEgkKzT c5q5ZlYQozsiYYtp7ZO9ITr1TIvQBws3HeIE3f+Gg2Uuxu/ZDIPOjWjmalcASN1UJPxs +OoX9vwsxlNPqvoMwacDehv4B9rlal89rIZ9TqezgF9T1b2z6GgM4rxPmZhDyLxEh2wJ mPB2lhBcK0luKqC5sUp1mtTJAxid3JTtT2PnxO+H97tjFmu6r2AeqBkb4wEK/mrkw0g0 FljFlXs0bxzIGgz2msKewLRbR9Bj3y4vYFXF9kcEHmAbf0Et2CjQzRuRV1eKZXXAsbjr cytA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=JQWsyFkyaghV2R+a926o9tF7HrebMHUTLhSTjjLBPy0=; b=ZRoKDCVmZef5Z+CFNWpJRp4Vb3TfB03/qLzdnGnbpHE0h3xwLtDVet11M+sUiBY+2T oTsS8apvBcB07ufGRpnIz9BDifqDMP9nO0E6EiatcoIlqfxR270A9vWYyHx92TA+cq2T qu28TeJFNMmTKw7W3Sfan9HCv2De1B2OM/04de+G0XRI4Got7grP08uXIMmVTyYhsVLU GlZF0zot8Qei9Egdkg4JvzKRQhfgC9GWLevr9pSkhDBCWHqPYHVnyAaXtqGD4el0wtgl OcSt1W2yQDVI0vyLUZ8tjjCAxf5vFoI38wFClYzYuy/jnLg+ukZOnZorkP9W5ilisOt8 wrzA== 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=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=marcan.st Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jv10si12129937ejc.625.2021.02.15.04.25.28; Mon, 15 Feb 2021 04:25:51 -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=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=marcan.st Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230393AbhBOMYm (ORCPT + 99 others); Mon, 15 Feb 2021 07:24:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54068 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230255AbhBOMUB (ORCPT ); Mon, 15 Feb 2021 07:20:01 -0500 Received: from mail.marcansoft.com (marcansoft.com [IPv6:2a01:298:fe:f::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 94788C0613D6; Mon, 15 Feb 2021 04:19:34 -0800 (PST) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: hector@marcansoft.com) by mail.marcansoft.com (Postfix) with ESMTPSA id 1A5804257B; Mon, 15 Feb 2021 12:19:27 +0000 (UTC) From: Hector Martin To: linux-arm-kernel@lists.infradead.org Cc: Hector Martin , Marc Zyngier , Rob Herring , Arnd Bergmann , Olof Johansson , Krzysztof Kozlowski , 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: [PATCH v2 23/25] tty: serial: samsung_tty: Add earlycon support for Apple UARTs Date: Mon, 15 Feb 2021 21:17:11 +0900 Message-Id: <20210215121713.57687-24-marcan@marcan.st> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210215121713.57687-1-marcan@marcan.st> References: <20210215121713.57687-1-marcan@marcan.st> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 + /* ... 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); +} + +OF_EARLYCON_DECLARE(s5l, "apple,s5l-uart", apple_s5l_early_console_setup); #endif MODULE_ALIAS("platform:samsung-uart"); -- 2.30.0