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.1 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,SPF_HELO_NONE,SPF_PASS,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 C7D47C47092 for ; Tue, 1 Jun 2021 14:59:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AE14161263 for ; Tue, 1 Jun 2021 14:59:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234451AbhFAPBN (ORCPT ); Tue, 1 Jun 2021 11:01:13 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:46823 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234393AbhFAPBJ (ORCPT ); Tue, 1 Jun 2021 11:01:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1622559567; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=vBakIu1dQtk22INC/4X9gLrUw+kGXTDgbjVD36Rzgzs=; b=fbeXQH4rXt7j5/AAE7GpIxdM1cQGYZV2vi9QDB5jzsgtr6ogRetNHJEL1H5nZll+6XjrPq eilb1OccATUY2yGp7homxPWPdxEX8Xluh1idSOiFwiorxkiA1wKH4D0Os8uDLqb+ejPqaP 2W9N1Lua66gh9eOxm8EOsNgCXr6Refg= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-153--HyZWk61MK-f-tn7ujNUNQ-1; Tue, 01 Jun 2021 10:59:25 -0400 X-MC-Unique: -HyZWk61MK-f-tn7ujNUNQ-1 Received: by mail-wm1-f72.google.com with SMTP id z25-20020a1c4c190000b029019f15b0657dso606018wmf.8 for ; Tue, 01 Jun 2021 07:59:25 -0700 (PDT) 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=vBakIu1dQtk22INC/4X9gLrUw+kGXTDgbjVD36Rzgzs=; b=N+n9T8hRz3wFJjFWQuob2yDf9+fbMb6GgsTvHvS05FZHNzd2iTigw4iS00GZfJUHnN uOOBgaV2Jn1rir3zA6Rdg4P7pf3ZG4IMF88BBeZnHikeVl12AG1pq7g6jDbdB4vXjE2B M0fzhaLvz/+tJyChCLFDJhithj11WqNZCR1sQL7dXFy5Fg1wEue8Gmj2UYonRgw0zi6j uTWopIZr5czaRS3DhTtFumQld0AcRLjpWAppJnD/zOMbSAX1Wqybzn27o88H5gdX4U4j ntGbmzQ8b6/ol46AWUDaj4e7i3mm97Gh0V+18HnOsdA73/B/EAERRG0WuI+/iL+eQWox rPrA== X-Gm-Message-State: AOAM533BhoFA9d1k9sKlC+hK61y81FBbtZvLpiwTpC3OoKgs2U4i8tOM KNc+ummICh9nj35lpSrnS67PhZZ3ZuGZZtw90jg007W9nmPgPIgZDzY5SXgGvjLXt8OBrYRFynh gPMS4SKvcmkUYtEB5jPBHgLXsP04V0tIvzU/0dLNfecyVMwUUz7JMsLc6LGFV6yaqeoEzDUORWu o= X-Received: by 2002:a1c:282:: with SMTP id 124mr350848wmc.82.1622559564400; Tue, 01 Jun 2021 07:59:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz9XbrF5UjA3Lkw2unmQqkjrGQdtKb1lFgUux9RmxthjhbwQ8B+MLPzmwDX65DDh6SYfSo0EA== X-Received: by 2002:a1c:282:: with SMTP id 124mr350790wmc.82.1622559564069; Tue, 01 Jun 2021 07:59:24 -0700 (PDT) Received: from minerva.redhat.com ([92.176.231.106]) by smtp.gmail.com with ESMTPSA id h6sm3533153wrt.6.2021.06.01.07.59.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Jun 2021 07:59:23 -0700 (PDT) From: Javier Martinez Canillas To: linux-kernel@vger.kernel.org Cc: Hans de Goede , Peter Robinson , dri-devel@lists.freedesktop.org, Daniel Vetter , Thomas Zimmermann , David Airlie , Javier Martinez Canillas , Albert Ou , Andy Shevchenko , Ard Biesheuvel , Arvind Sankar , Bjorn Andersson , Borislav Petkov , Brijesh Singh , Catalin Marinas , Chester Lin , Dinh Nguyen , Greg Kroah-Hartman , "H. Peter Anvin" , Ingo Molnar , Joerg Roedel , John Stultz , Josh Poimboeuf , Juergen Gross , Kalle Valo , Krzysztof Kozlowski , Linus Walleij , Nicolas Saenz Julienne , Palmer Dabbelt , Paul Walmsley , "Peter Zijlstra (Intel)" , Russell King , Sudeep Holla , Thomas Gleixner , Will Deacon , linux-arm-kernel@lists.infradead.org, linux-efi@vger.kernel.org, linux-riscv@lists.infradead.org, x86@kernel.org Subject: [PATCH v2 0/2] allow simple{fb,drm} drivers to be used on non-x86 EFI platforms Date: Tue, 1 Jun 2021 16:59:10 +0200 Message-Id: <20210601145912.774054-1-javierm@redhat.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The simplefb and simpledrm drivers match against a "simple-framebuffer" device, but for aarch64 this is only registered when using Device Trees and there's a node with a "simple-framebuffer" compatible string. There is no code to register a "simple-framebuffer" platform device when using EFI instead. In fact, the only platform device that's registered in this case is an "efi-framebuffer", which means that the efifb driver is the only driver supported to have an early console with EFI on aarch64. The x86 architecture platform has a Generic System Framebuffers (sysfb) support, that register a system frambuffer platform device. It either registers a "simple-framebuffer" for the simple{fb,drm} drivers or legacy VGA/EFI FB devices for the vgafb/efifb drivers. The sysfb is generic enough to be reused by other architectures and can be moved out of the arch/x86 directory to drivers/firmware, allowing the EFI logic used by non-x86 architectures to be folded into sysfb as well. Patch #1 in this series do the former while patch #2 do the latter. It has been tested on x86_64 and aarch64 machines using the efifb, simplefb and simpledrm drivers. But more testing will be highly appreciated, to make sure that no regressions are being introduced by these changes. The series touches different subystems and will need coordination between maintainers. Ard Biesheuvel said that can be merged through the EFI tree. Best regards, Javier Changes in v2: - Use default y and depends on X86 instead doing a select in arch/x86/Kconfig. - Also enable the SYSFB Kconfig option when COMPILE_TEST. - Improve commit message to explain why is useful for other arches to use this. - Use "depends on" for the supported architectures instead of selecting it. - Improve commit message to explain the benefits of reusing sysfb for !X86. Javier Martinez Canillas (2): drivers/firmware: move x86 Generic System Framebuffers support drivers/firmware: consolidate EFI framebuffer setup for all arches arch/arm/include/asm/efi.h | 5 +- arch/arm64/include/asm/efi.h | 5 +- arch/riscv/include/asm/efi.h | 5 +- arch/x86/Kconfig | 26 ------ arch/x86/kernel/Makefile | 3 - drivers/firmware/Kconfig | 32 +++++++ drivers/firmware/Makefile | 2 + drivers/firmware/efi/Makefile | 2 + drivers/firmware/efi/efi-init.c | 90 ------------------- .../firmware/efi}/sysfb_efi.c | 79 +++++++++++++++- {arch/x86/kernel => drivers/firmware}/sysfb.c | 42 +++++---- .../firmware}/sysfb_simplefb.c | 31 ++++--- .../x86/include/asm => include/linux}/sysfb.h | 34 +++---- 13 files changed, 180 insertions(+), 176 deletions(-) rename {arch/x86/kernel => drivers/firmware/efi}/sysfb_efi.c (84%) rename {arch/x86/kernel => drivers/firmware}/sysfb.c (70%) rename {arch/x86/kernel => drivers/firmware}/sysfb_simplefb.c (82%) rename {arch/x86/include/asm => include/linux}/sysfb.h (68%) -- 2.31.1 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=-12.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,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 D5F66C4708F for ; Tue, 1 Jun 2021 14:59:51 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 93DD36128A for ; Tue, 1 Jun 2021 14:59:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 93DD36128A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=uXPEDBeGvUvXPBPn8c2smlCzPZRbTwY7ZuXHfJgcTGI=; b=teXDnZ9J53anmQ A3uOXfA3JlYkKwwoUso2Vc5rGDIOAZfJHoG9nAgjZHUCRoMpAgCwMNMJ0D2srWKJo/Tny2K4slLbG tF/oWDEFBvgeAh5Elmu3sll/08qRIoRiIDSPxyGUH6ashZSGWWh8nMHTBbWK8M8/7KqARiaKsk6uy /rqiRoYt/FenwnycQExrUJfbILuFIzlll+EHg6oAOc5Qf6wjgWan+wRYh/onRe4jGu2oJJSYIyJWW 35Xo4L/nbeI0BO24DuyZiVrvcqrykAWoiIBGaqnWjqrhxLpqbFbruOaY0+2CT+UEPv3pccTeXgtg0 lJQ+VdlZRYQastu7hhyg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lo5ri-00H3VH-2q; Tue, 01 Jun 2021 14:59:34 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lo5rf-00H3TD-Nr for linux-riscv@lists.infradead.org; Tue, 01 Jun 2021 14:59:33 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1622559569; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vBakIu1dQtk22INC/4X9gLrUw+kGXTDgbjVD36Rzgzs=; b=YeOH+ZU7dUx07FzkaochgoLDC3rTBP9xB91NWT22UK7FVPmrkeusLY10rnSbD2C5RU/D8L ySRhomMUxwlcyQMcF4q2oiOsqpnDpdT/89wWWRC9Bf9XFhJYmbcyjlJvHWGkKpHIcfbUpn pWKZtrvXK/CLsLtsEjWiEPXF0ZFVCTc= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-24-zAFusT0cMUux1GcMethfCw-1; Tue, 01 Jun 2021 10:59:25 -0400 X-MC-Unique: zAFusT0cMUux1GcMethfCw-1 Received: by mail-wr1-f72.google.com with SMTP id k25-20020a5d52590000b0290114dee5b660so3316104wrc.16 for ; Tue, 01 Jun 2021 07:59:25 -0700 (PDT) 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=vBakIu1dQtk22INC/4X9gLrUw+kGXTDgbjVD36Rzgzs=; b=il/0VWWH022hN6553QNxuASFFidI7CvWnrML1SZ/s9YaGrKMFgzeDoAY+yVVzjRHGf NHTemsZ4GsZuun508EUTFjMnPpP+1PSRfZOo8L30Av1ZNNFMWusAVr89brgstS070niz dSJKUKMF+S1HNeXODAzsCD/m2BGa//o00CZVzMT63OjcmRz/1wKOE2/xRLx08F5o9mLu 7+85skjfx3GlKy1lhNAhMBrwTe7/KjnjpBWNLouCmMFA6LEK7OWfme7DlcxtaFbS/9vQ D2klXtqcWgPUS75XG9ISsQ1hhAXt3M0HnlXpZudCsfL1+fcWoEe7h7CoMsmYsTMXy6bp l5Uw== X-Gm-Message-State: AOAM530fuurYfGCAoLN50/So8TLIw2ZiDuZG8V4TRWy2MMSW0oGTvHie JEOuPjGb0fO92HGAP4XX8kJgRsCFQ54+ya64stKmDmOOi2kwHkEYWSBaAdS2QiqkoVqKgK7Ai3C tcSvoj0MndLcDruZ9yjwjyyLd/K7T X-Received: by 2002:a1c:282:: with SMTP id 124mr350824wmc.82.1622559564312; Tue, 01 Jun 2021 07:59:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz9XbrF5UjA3Lkw2unmQqkjrGQdtKb1lFgUux9RmxthjhbwQ8B+MLPzmwDX65DDh6SYfSo0EA== X-Received: by 2002:a1c:282:: with SMTP id 124mr350790wmc.82.1622559564069; Tue, 01 Jun 2021 07:59:24 -0700 (PDT) Received: from minerva.redhat.com ([92.176.231.106]) by smtp.gmail.com with ESMTPSA id h6sm3533153wrt.6.2021.06.01.07.59.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Jun 2021 07:59:23 -0700 (PDT) From: Javier Martinez Canillas To: linux-kernel@vger.kernel.org Cc: Hans de Goede , Peter Robinson , dri-devel@lists.freedesktop.org, Daniel Vetter , Thomas Zimmermann , David Airlie , Javier Martinez Canillas , Albert Ou , Andy Shevchenko , Ard Biesheuvel , Arvind Sankar , Bjorn Andersson , Borislav Petkov , Brijesh Singh , Catalin Marinas , Chester Lin , Dinh Nguyen , Greg Kroah-Hartman , "H. Peter Anvin" , Ingo Molnar , Joerg Roedel , John Stultz , Josh Poimboeuf , Juergen Gross , Kalle Valo , Krzysztof Kozlowski , Linus Walleij , Nicolas Saenz Julienne , Palmer Dabbelt , Paul Walmsley , "Peter Zijlstra (Intel)" , Russell King , Sudeep Holla , Thomas Gleixner , Will Deacon , linux-arm-kernel@lists.infradead.org, linux-efi@vger.kernel.org, linux-riscv@lists.infradead.org, x86@kernel.org Subject: [PATCH v2 0/2] allow simple{fb, drm} drivers to be used on non-x86 EFI platforms Date: Tue, 1 Jun 2021 16:59:10 +0200 Message-Id: <20210601145912.774054-1-javierm@redhat.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=javierm@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210601_075931_879620_BC055DBF X-CRM114-Status: GOOD ( 19.14 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org The simplefb and simpledrm drivers match against a "simple-framebuffer" device, but for aarch64 this is only registered when using Device Trees and there's a node with a "simple-framebuffer" compatible string. There is no code to register a "simple-framebuffer" platform device when using EFI instead. In fact, the only platform device that's registered in this case is an "efi-framebuffer", which means that the efifb driver is the only driver supported to have an early console with EFI on aarch64. The x86 architecture platform has a Generic System Framebuffers (sysfb) support, that register a system frambuffer platform device. It either registers a "simple-framebuffer" for the simple{fb,drm} drivers or legacy VGA/EFI FB devices for the vgafb/efifb drivers. The sysfb is generic enough to be reused by other architectures and can be moved out of the arch/x86 directory to drivers/firmware, allowing the EFI logic used by non-x86 architectures to be folded into sysfb as well. Patch #1 in this series do the former while patch #2 do the latter. It has been tested on x86_64 and aarch64 machines using the efifb, simplefb and simpledrm drivers. But more testing will be highly appreciated, to make sure that no regressions are being introduced by these changes. The series touches different subystems and will need coordination between maintainers. Ard Biesheuvel said that can be merged through the EFI tree. Best regards, Javier Changes in v2: - Use default y and depends on X86 instead doing a select in arch/x86/Kconfig. - Also enable the SYSFB Kconfig option when COMPILE_TEST. - Improve commit message to explain why is useful for other arches to use this. - Use "depends on" for the supported architectures instead of selecting it. - Improve commit message to explain the benefits of reusing sysfb for !X86. Javier Martinez Canillas (2): drivers/firmware: move x86 Generic System Framebuffers support drivers/firmware: consolidate EFI framebuffer setup for all arches arch/arm/include/asm/efi.h | 5 +- arch/arm64/include/asm/efi.h | 5 +- arch/riscv/include/asm/efi.h | 5 +- arch/x86/Kconfig | 26 ------ arch/x86/kernel/Makefile | 3 - drivers/firmware/Kconfig | 32 +++++++ drivers/firmware/Makefile | 2 + drivers/firmware/efi/Makefile | 2 + drivers/firmware/efi/efi-init.c | 90 ------------------- .../firmware/efi}/sysfb_efi.c | 79 +++++++++++++++- {arch/x86/kernel => drivers/firmware}/sysfb.c | 42 +++++---- .../firmware}/sysfb_simplefb.c | 31 ++++--- .../x86/include/asm => include/linux}/sysfb.h | 34 +++---- 13 files changed, 180 insertions(+), 176 deletions(-) rename {arch/x86/kernel => drivers/firmware/efi}/sysfb_efi.c (84%) rename {arch/x86/kernel => drivers/firmware}/sysfb.c (70%) rename {arch/x86/kernel => drivers/firmware}/sysfb_simplefb.c (82%) rename {arch/x86/include/asm => include/linux}/sysfb.h (68%) -- 2.31.1 _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv 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=-12.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,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 BEDF2C47080 for ; Tue, 1 Jun 2021 15:01:30 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 7A34B61263 for ; Tue, 1 Jun 2021 15:01:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7A34B61263 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com 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=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=+0pUFOdUEv5SSyTOBzJIMD1uHFqkIRSfAZtiMJVphvk=; b=S+qXqz4OvlXmCr 3acUI/DXSLPb8tqA1m0fnX0va67CWo1dah7o/lcDGiGnU5kLhJZt1KTf01OLXM/BcNPmnpgvYjJIW gVfDGC6LVCtJgBM7IWz+0eImbhbpmES/PhVW86/w6O7zDq5XluJN6atSfUo2pLJFZ70oZX7r8LvEm tAYbPbm5AKbU+YdnhVLtMQNWHtTDqr16jaBzhAStykrlyjRshafu6holCgIhOGm8VKZCxoplAWuj7 zjXaLDnf8X5Y2TFM2gVUdXWfKRtqZryUHN4OJ4eakr1Asaa2G9+64VsZNO+fuvKQySPNGGbaW7NI2 hxcwT8koWEV52jzUY/QA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lo5rk-00H3WD-Uq; Tue, 01 Jun 2021 14:59:37 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lo5rf-00H3TC-TI for linux-arm-kernel@lists.infradead.org; Tue, 01 Jun 2021 14:59:33 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1622559569; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vBakIu1dQtk22INC/4X9gLrUw+kGXTDgbjVD36Rzgzs=; b=YeOH+ZU7dUx07FzkaochgoLDC3rTBP9xB91NWT22UK7FVPmrkeusLY10rnSbD2C5RU/D8L ySRhomMUxwlcyQMcF4q2oiOsqpnDpdT/89wWWRC9Bf9XFhJYmbcyjlJvHWGkKpHIcfbUpn pWKZtrvXK/CLsLtsEjWiEPXF0ZFVCTc= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-64-ACdRC8pGNQmBZ6gUZdDwrQ-1; Tue, 01 Jun 2021 10:59:25 -0400 X-MC-Unique: ACdRC8pGNQmBZ6gUZdDwrQ-1 Received: by mail-wr1-f71.google.com with SMTP id x9-20020adfffc90000b02901178add5f60so973598wrs.5 for ; Tue, 01 Jun 2021 07:59:25 -0700 (PDT) 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=vBakIu1dQtk22INC/4X9gLrUw+kGXTDgbjVD36Rzgzs=; b=AQWuE+QdkMe3YsnmIex6ocrkxiam+pYivoYOO0vSuNbn19nQ/VsDX8ub6stWSHU7CI 089zKqRMMOmPDl+cXOod6ipcbwricC8K7wAywfoO/w6NgEUsSq8H0ik9cgXmYsfPv/08 3SWyNSEFoecOQM57hU1iQ2ANVvtK+l3abdDkn9NSklu2sYvMs4wLhI+kulgfwVZ2sjW/ MxElUIUdq6Y81S5aBgqemZZveVmUgPdf9ov/l6BjePEPHRceORfVlCTVOZsEacxYizDU 9i9O+BtoSLM7HlDjaK69mHKpVw68MCtg19AyqaLaPIkYYveQx7TEZhQFnJSRoehZb4Sa jRaA== X-Gm-Message-State: AOAM530hQBiuOtwubCKBzwdurH08JxU4xA+K4Nf54PJTl1XuBy3A+QM7 zBv4Q2UpX/ebhlTBkO6H/dV7HyCyYMmCnQ9Rl1pVpFNcFS3AJSZHhE/QcgjpCpW3SYpAZI5ZW1V CXVp31Hid6Ea66kPDMUY+hDbU+XffaI6or5g= X-Received: by 2002:a1c:282:: with SMTP id 124mr350816wmc.82.1622559564311; Tue, 01 Jun 2021 07:59:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz9XbrF5UjA3Lkw2unmQqkjrGQdtKb1lFgUux9RmxthjhbwQ8B+MLPzmwDX65DDh6SYfSo0EA== X-Received: by 2002:a1c:282:: with SMTP id 124mr350790wmc.82.1622559564069; Tue, 01 Jun 2021 07:59:24 -0700 (PDT) Received: from minerva.redhat.com ([92.176.231.106]) by smtp.gmail.com with ESMTPSA id h6sm3533153wrt.6.2021.06.01.07.59.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Jun 2021 07:59:23 -0700 (PDT) From: Javier Martinez Canillas To: linux-kernel@vger.kernel.org Cc: Hans de Goede , Peter Robinson , dri-devel@lists.freedesktop.org, Daniel Vetter , Thomas Zimmermann , David Airlie , Javier Martinez Canillas , Albert Ou , Andy Shevchenko , Ard Biesheuvel , Arvind Sankar , Bjorn Andersson , Borislav Petkov , Brijesh Singh , Catalin Marinas , Chester Lin , Dinh Nguyen , Greg Kroah-Hartman , "H. Peter Anvin" , Ingo Molnar , Joerg Roedel , John Stultz , Josh Poimboeuf , Juergen Gross , Kalle Valo , Krzysztof Kozlowski , Linus Walleij , Nicolas Saenz Julienne , Palmer Dabbelt , Paul Walmsley , "Peter Zijlstra (Intel)" , Russell King , Sudeep Holla , Thomas Gleixner , Will Deacon , linux-arm-kernel@lists.infradead.org, linux-efi@vger.kernel.org, linux-riscv@lists.infradead.org, x86@kernel.org Subject: [PATCH v2 0/2] allow simple{fb, drm} drivers to be used on non-x86 EFI platforms Date: Tue, 1 Jun 2021 16:59:10 +0200 Message-Id: <20210601145912.774054-1-javierm@redhat.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=javierm@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210601_075932_030118_190DBA4D X-CRM114-Status: GOOD ( 20.66 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 The simplefb and simpledrm drivers match against a "simple-framebuffer" device, but for aarch64 this is only registered when using Device Trees and there's a node with a "simple-framebuffer" compatible string. There is no code to register a "simple-framebuffer" platform device when using EFI instead. In fact, the only platform device that's registered in this case is an "efi-framebuffer", which means that the efifb driver is the only driver supported to have an early console with EFI on aarch64. The x86 architecture platform has a Generic System Framebuffers (sysfb) support, that register a system frambuffer platform device. It either registers a "simple-framebuffer" for the simple{fb,drm} drivers or legacy VGA/EFI FB devices for the vgafb/efifb drivers. The sysfb is generic enough to be reused by other architectures and can be moved out of the arch/x86 directory to drivers/firmware, allowing the EFI logic used by non-x86 architectures to be folded into sysfb as well. Patch #1 in this series do the former while patch #2 do the latter. It has been tested on x86_64 and aarch64 machines using the efifb, simplefb and simpledrm drivers. But more testing will be highly appreciated, to make sure that no regressions are being introduced by these changes. The series touches different subystems and will need coordination between maintainers. Ard Biesheuvel said that can be merged through the EFI tree. Best regards, Javier Changes in v2: - Use default y and depends on X86 instead doing a select in arch/x86/Kconfig. - Also enable the SYSFB Kconfig option when COMPILE_TEST. - Improve commit message to explain why is useful for other arches to use this. - Use "depends on" for the supported architectures instead of selecting it. - Improve commit message to explain the benefits of reusing sysfb for !X86. Javier Martinez Canillas (2): drivers/firmware: move x86 Generic System Framebuffers support drivers/firmware: consolidate EFI framebuffer setup for all arches arch/arm/include/asm/efi.h | 5 +- arch/arm64/include/asm/efi.h | 5 +- arch/riscv/include/asm/efi.h | 5 +- arch/x86/Kconfig | 26 ------ arch/x86/kernel/Makefile | 3 - drivers/firmware/Kconfig | 32 +++++++ drivers/firmware/Makefile | 2 + drivers/firmware/efi/Makefile | 2 + drivers/firmware/efi/efi-init.c | 90 ------------------- .../firmware/efi}/sysfb_efi.c | 79 +++++++++++++++- {arch/x86/kernel => drivers/firmware}/sysfb.c | 42 +++++---- .../firmware}/sysfb_simplefb.c | 31 ++++--- .../x86/include/asm => include/linux}/sysfb.h | 34 +++---- 13 files changed, 180 insertions(+), 176 deletions(-) rename {arch/x86/kernel => drivers/firmware/efi}/sysfb_efi.c (84%) rename {arch/x86/kernel => drivers/firmware}/sysfb.c (70%) rename {arch/x86/kernel => drivers/firmware}/sysfb_simplefb.c (82%) rename {arch/x86/include/asm => include/linux}/sysfb.h (68%) -- 2.31.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel 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=-11.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,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 DE052C4708F for ; Tue, 1 Jun 2021 14:59:31 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 A100561263 for ; Tue, 1 Jun 2021 14:59:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A100561263 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0D3196E11F; Tue, 1 Jun 2021 14:59:31 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5C7C56E11F for ; Tue, 1 Jun 2021 14:59:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1622559567; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vBakIu1dQtk22INC/4X9gLrUw+kGXTDgbjVD36Rzgzs=; b=CS5fvpD3UJ7Rcr1R9OEmTFawx93/7jz++3X0Mky6FyFwzxgpTFcpo0catcBHPGtjQoT9X2 FHioTQe/Rsig26e4qsufAUAzVesF6bio8TYxhXedSw/l5oFSuWjB3VR/nZQws4gRjPZfHo mMfn2YWiX5n6vkzkFdNrII/JnbgNdIE= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-360-2QlIuUR0Pb67gVdl4Zgqcg-1; Tue, 01 Jun 2021 10:59:25 -0400 X-MC-Unique: 2QlIuUR0Pb67gVdl4Zgqcg-1 Received: by mail-wr1-f72.google.com with SMTP id z4-20020adfe5440000b0290114f89c9931so2790034wrm.17 for ; Tue, 01 Jun 2021 07:59:25 -0700 (PDT) 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=vBakIu1dQtk22INC/4X9gLrUw+kGXTDgbjVD36Rzgzs=; b=TOHefb8nAQU7kT0etVy8dk5GLCERcXuJ794BvJxRja22quYte6FAZGFPOrnLg5U9vs 7rKhbdIhNX/J+lilrU4lvzdByNYvK3nndmveiTiyoBlOkRawgIlh+tk4EVi6Voi1vUof kFHqg9NPfu+/mP4tuKvyy/9He9zxVoi0BK7AU7kiWlmyj1b92wJ3N+SfmaP0i+8xLhmK EvALqsRWuOOlUJ6uXAO6PYxfHFNrdJ59lCzv8pGXLUCMPGpnRyn3PRuzoI8oQhzQhVbC rGKA530C+wCWGFwotjJaDSXTXUB7KiaPV9fVctf5waNyEIOmCX629Mg1HPOL85jZW8H7 7eKQ== X-Gm-Message-State: AOAM531TM9UtnSlFGEiww4sBM3+huoF5kopTbxOmUUd/SA6VFIMcf+Tp r4LUE9vlB+EQJz3YoUgSIuGISwi/3Ada3W1mLocAmL16FkNIfduUdsrium6u08RiA3RjrGuIkdp TeCKFgYuj3ZnAYBokgNTOiabn4SmT X-Received: by 2002:a1c:282:: with SMTP id 124mr350836wmc.82.1622559564314; Tue, 01 Jun 2021 07:59:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz9XbrF5UjA3Lkw2unmQqkjrGQdtKb1lFgUux9RmxthjhbwQ8B+MLPzmwDX65DDh6SYfSo0EA== X-Received: by 2002:a1c:282:: with SMTP id 124mr350790wmc.82.1622559564069; Tue, 01 Jun 2021 07:59:24 -0700 (PDT) Received: from minerva.redhat.com ([92.176.231.106]) by smtp.gmail.com with ESMTPSA id h6sm3533153wrt.6.2021.06.01.07.59.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Jun 2021 07:59:23 -0700 (PDT) From: Javier Martinez Canillas To: linux-kernel@vger.kernel.org Subject: [PATCH v2 0/2] allow simple{fb, drm} drivers to be used on non-x86 EFI platforms Date: Tue, 1 Jun 2021 16:59:10 +0200 Message-Id: <20210601145912.774054-1-javierm@redhat.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=javierm@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-efi@vger.kernel.org, Brijesh Singh , David Airlie , Catalin Marinas , Paul Walmsley , dri-devel@lists.freedesktop.org, Bjorn Andersson , Arvind Sankar , Joerg Roedel , "H. Peter Anvin" , Russell King , linux-riscv@lists.infradead.org, Will Deacon , Ard Biesheuvel , Krzysztof Kozlowski , x86@kernel.org, Javier Martinez Canillas , "Peter Zijlstra \(Intel\)" , Ingo Molnar , Peter Robinson , linux-arm-kernel@lists.infradead.org, Albert Ou , Chester Lin , Hans de Goede , Borislav Petkov , Josh Poimboeuf , Thomas Gleixner , Andy Shevchenko , Kalle Valo , Juergen Gross , Greg Kroah-Hartman , Dinh Nguyen , Nicolas Saenz Julienne , Palmer Dabbelt , Thomas Zimmermann , Sudeep Holla Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The simplefb and simpledrm drivers match against a "simple-framebuffer" device, but for aarch64 this is only registered when using Device Trees and there's a node with a "simple-framebuffer" compatible string. There is no code to register a "simple-framebuffer" platform device when using EFI instead. In fact, the only platform device that's registered in this case is an "efi-framebuffer", which means that the efifb driver is the only driver supported to have an early console with EFI on aarch64. The x86 architecture platform has a Generic System Framebuffers (sysfb) support, that register a system frambuffer platform device. It either registers a "simple-framebuffer" for the simple{fb,drm} drivers or legacy VGA/EFI FB devices for the vgafb/efifb drivers. The sysfb is generic enough to be reused by other architectures and can be moved out of the arch/x86 directory to drivers/firmware, allowing the EFI logic used by non-x86 architectures to be folded into sysfb as well. Patch #1 in this series do the former while patch #2 do the latter. It has been tested on x86_64 and aarch64 machines using the efifb, simplefb and simpledrm drivers. But more testing will be highly appreciated, to make sure that no regressions are being introduced by these changes. The series touches different subystems and will need coordination between maintainers. Ard Biesheuvel said that can be merged through the EFI tree. Best regards, Javier Changes in v2: - Use default y and depends on X86 instead doing a select in arch/x86/Kconfig. - Also enable the SYSFB Kconfig option when COMPILE_TEST. - Improve commit message to explain why is useful for other arches to use this. - Use "depends on" for the supported architectures instead of selecting it. - Improve commit message to explain the benefits of reusing sysfb for !X86. Javier Martinez Canillas (2): drivers/firmware: move x86 Generic System Framebuffers support drivers/firmware: consolidate EFI framebuffer setup for all arches arch/arm/include/asm/efi.h | 5 +- arch/arm64/include/asm/efi.h | 5 +- arch/riscv/include/asm/efi.h | 5 +- arch/x86/Kconfig | 26 ------ arch/x86/kernel/Makefile | 3 - drivers/firmware/Kconfig | 32 +++++++ drivers/firmware/Makefile | 2 + drivers/firmware/efi/Makefile | 2 + drivers/firmware/efi/efi-init.c | 90 ------------------- .../firmware/efi}/sysfb_efi.c | 79 +++++++++++++++- {arch/x86/kernel => drivers/firmware}/sysfb.c | 42 +++++---- .../firmware}/sysfb_simplefb.c | 31 ++++--- .../x86/include/asm => include/linux}/sysfb.h | 34 +++---- 13 files changed, 180 insertions(+), 176 deletions(-) rename {arch/x86/kernel => drivers/firmware/efi}/sysfb_efi.c (84%) rename {arch/x86/kernel => drivers/firmware}/sysfb.c (70%) rename {arch/x86/kernel => drivers/firmware}/sysfb_simplefb.c (82%) rename {arch/x86/include/asm => include/linux}/sysfb.h (68%) -- 2.31.1