Received: by 2002:a05:6358:f14:b0:e5:3b68:ec04 with SMTP id b20csp5479887rwj; Wed, 21 Dec 2022 03:17:58 -0800 (PST) X-Google-Smtp-Source: AMrXdXusq/hTe4Vcac0fzg/HoCuD5vACZpMxMjOonnWEGjNBvQVDPqj9uSUjkhZD7IpbZwgGc4IR X-Received: by 2002:a17:907:93c5:b0:7ad:e255:9238 with SMTP id cp5-20020a17090793c500b007ade2559238mr926483ejc.21.1671621478104; Wed, 21 Dec 2022 03:17:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671621478; cv=none; d=google.com; s=arc-20160816; b=MpUacGcMXIUmxY8lsZzRXNaw2+vPEineaXLUnHngt47HSZrNwx+zqSeDwkTce3dFQ8 pYBp6BjbTsBDsnZAQAiAg1LBiQmE6HSDXos+Vp8FHum2Iu5WyG6MKNuSuoW2bASDenUH xTXHK6NMNPN/VEQzrhCq8q3IIg+rdztjoRJ5tpc9NqFZ4Pr9BEJe5RGwtP2NTsP/td/w rh8eWdg6l4/c9WyMJKRwm2Cb5vK9ws5CRS0JR3CGzYjUzcmXchqX+zEIONRqxjjnROoD yH/7gTBS4oSXA9ZYBlR43AcUS4eZApTkx1U6+ynx0PER831Lbe0lGHOKnoEaPjTV+P+4 vC3A== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=dYF4aCoOjNocXMp5ObQdxM+1IiESaniY5tGPacmK2hI=; b=RvX3v6QxXK8rH5N1g2tR8beqyIK4A/sLjzy2q72+kNGvoCco6gIIfz28KscrRm9ZQF eFFZYrMNyiWv51MpdHL+ukxDomOYkZZ+1Kl0f7mOd+A1y4COFV4Fnk9QpwlF0alnsdaC 8ahA96ijKjV6zeYLzqIJH3+ojmJlHUPTP15ixlToAHGEihxlS38BwjxGiax9HISxDMbQ 1pd9alar0yR4pHiwFeDcxjb4V7WJrmqoaBpd629eGzY1VchSn3deiiPYoVV+mpLprG4L SOIYQTU15FMa6camvDXPPYB+6kj8dvN8o9w3xBPeaowoy4OBiQdZDCEsgqbyTxvbfb2Q Yi2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=UPW7reYD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f21-20020aa7d855000000b0046bccab3947si11956201eds.469.2022.12.21.03.17.38; Wed, 21 Dec 2022 03:17:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=UPW7reYD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234521AbiLUKyi (ORCPT + 69 others); Wed, 21 Dec 2022 05:54:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33008 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229596AbiLUKyg (ORCPT ); Wed, 21 Dec 2022 05:54:36 -0500 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 658591902F; Wed, 21 Dec 2022 02:54:35 -0800 (PST) Received: by mail-wr1-x432.google.com with SMTP id i7so14495569wrv.8; Wed, 21 Dec 2022 02:54:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=dYF4aCoOjNocXMp5ObQdxM+1IiESaniY5tGPacmK2hI=; b=UPW7reYDRuGDUoiD+Lb3uTPFeJy8MKOAkABhUJagUeaIYU2k84h1Kbzb2indRGVCZ/ +nH3idszhlY/oUm6Zvg6tHwqhKOVw6u5cipKErnxKQsnKJ8G4IvA3UyMnfjorA8szIBA I9JsUylJt8PX4aPDA8l4ich2/9lN6I4mEyMBRk5iXtA6hhfqo3IxHTZFJZRjqFMLKbsp dEzycxHUNgzX6Ur9PxTwGkpja06mu+WlioLu0T/qj0rgpVbaFCaQJJdD17J208t5tQ1c T3ywqFaYmQE6qB2qnWrGLYiyPdKqjcE/oxCRMdnGXpufnq9kZVHvaGfHYtDof2gIy8sE hSEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=dYF4aCoOjNocXMp5ObQdxM+1IiESaniY5tGPacmK2hI=; b=rGkXSsGkQUFqrNl8Y6PB6rV6qGeF09jcwJIITNyimhs8vcI4JJHQd4RwPoObzcVSWy 7G+ZU/ZjqjwW9PBz6hE6cwJBtxSowiIdxXbw0cyColOHqIeUX/HhEKFxCUrQna4H1Wjy SUvHMgSkfRZL7QRixBrBmYkSc7UWWPuOQwPvZhtKcnokiTeQQ31F+t7hrjIQ7Ym+M6yu t53yO9/Pwf14xcQ3xM9vOTZat8EuXPwOAfbr3ZmtGwpo3N83TmzsfYWXSgVZFCVZ9wUl iAQ7i4bzb3jp2i06NSwS28y+rDYwoMqE0ueN4VWG1bXBt14rFzS1zZMdVf+Zxkmj/rJL uufg== X-Gm-Message-State: AFqh2kpibcl7xXPb6mtIkOrZ54fWUeQTiHMTj5EicASeu6P/QQgmgAxQ 9Q1uCtBX4mv4r4icJadMbASROYrkSa1GVw== X-Received: by 2002:adf:eecf:0:b0:24a:852d:e292 with SMTP id a15-20020adfeecf000000b0024a852de292mr779711wrp.46.1671620073626; Wed, 21 Dec 2022 02:54:33 -0800 (PST) Received: from localhost.localdomain ([37.55.203.63]) by smtp.gmail.com with ESMTPSA id y5-20020a056000108500b0023657e1b980sm15080156wrw.53.2022.12.21.02.54.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Dec 2022 02:54:33 -0800 (PST) From: Markuss Broks To: linux-kernel@vger.kernel.org Cc: Jami Kettunen , Markuss Broks , Jonathan Corbet , Ard Biesheuvel , Greg Kroah-Hartman , Jiri Slaby , Helge Deller , Borislav Petkov , "Paul E. McKenney" , Andrew Morton , Will Deacon , Randy Dunlap , Muchun Song , Damien Le Moal , Kim Phillips , linux-doc@vger.kernel.org, linux-efi@vger.kernel.org, linux-serial@vger.kernel.org, linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: [PATCH v3 0/3] Add generic framebuffer support to EFI earlycon driver Date: Wed, 21 Dec 2022 12:53:57 +0200 Message-Id: <20221221105402.6598-1-markuss.broks@gmail.com> X-Mailer: git-send-email 2.39.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Make the EFI earlycon driver be suitable for any linear framebuffers. This should be helpful for early porting of boards with no other means of output, like smartphones/tablets. There seems to be an issue with early_ioremap function on ARM32, but I am unable to find the exact cause. It appears the mappings returned by it are somehow incorrect, thus the driver is disabled on ARM. EFI early console was disabled on IA64 previously because of missing early_memremap_prot, and this is inherited to this driver. This patch also changes behavior on EFI systems, by selecting the mapping type based on if the framebuffer region intersects with system RAM. If it does, it's common sense that it should be in RAM as a whole, and so the system RAM mapping is used. It was tested to be working on my PC (Intel Z490 platform), as well as several ARM64 boards (Samsung Galaxy S9 (Exynos), iPad Air 2, Xiaomi Mi Pad 4, ...). Markuss Broks (2): drivers: serial: earlycon: Pass device-tree node efi: earlycon: Add support for generic framebuffers and move to fbdev subsystem v1 -> v2: - a new patch correcting serial/earlycon.c argument name to "offset" instead of "node" - move IA64 exclusion from EFI earlycon Kconfig to earlycon driver Kconfig (IA64 has no early_memremap_prot) - move driver from fbdev to console subsystem - select EFI earlycon by default - fetch stride manually from device-tree, as on some devices it seems stride doesn't match the horizontal resolution * bpp. - use saner format (e.g. 1920x1080x32 instead of 1920,1080,32). Markuss Broks (3): drivers: serial: earlycon: Pass device-tree node efi: earlycon: move to video/console to prepare for changes efi: earlycon: Add support for generic framebuffers .../admin-guide/kernel-parameters.txt | 12 +- MAINTAINERS | 5 + drivers/firmware/efi/Kconfig | 7 +- drivers/firmware/efi/Makefile | 1 - drivers/firmware/efi/earlycon.c | 246 -------------- drivers/tty/serial/earlycon.c | 3 + drivers/video/console/Kconfig | 11 + drivers/video/console/Makefile | 1 + drivers/video/console/earlycon.c | 305 ++++++++++++++++++ include/linux/serial_core.h | 1 + 10 files changed, 336 insertions(+), 256 deletions(-) delete mode 100644 drivers/firmware/efi/earlycon.c create mode 100644 drivers/video/console/earlycon.c -- 2.39.0