Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp2973374pxm; Mon, 28 Feb 2022 09:30:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJyWS9T44A/vxwNlv6ByU6pbXFdmZqbKmv2Kq6a2Q8v9656b/Rq7i0w00IZkvYWnDSvRQUCM X-Received: by 2002:aa7:d4ca:0:b0:410:d232:6b76 with SMTP id t10-20020aa7d4ca000000b00410d2326b76mr20685486edr.370.1646069441076; Mon, 28 Feb 2022 09:30:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646069441; cv=none; d=google.com; s=arc-20160816; b=DcrRz9Vtvkx1gPllI77iZM8jv8irsQYEzIjaN3aXbSPfxEQQwn2sXq6NedXbJWP25N GnPUOhgetES4zgewhU2ajqILphgwL5vKe/N7sCdjEYEDNUe6QZT2R6HEY8ROdwOA/R/P pXi90ELjF/IkS4kWHZ7GvghcBFZwFbJSDP7W1A6aofh3nYTd8ZrS++iE+MvOfsZqoSdS K2FiTz8GOjfeokgvY71U7BQ3hgKAa50ka9R2+x2tk5gmLentSOy1tKkNSmdJxNAEejSf /PbeOehNd1K+vR1cyVSVCzGcon42qkfTgQYpYl9mlD6dVKhqj8hF6vTpc2O3lI7voHDb FVIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=VpTjIs0hzrsh4I+aITjeOAjdM8laTn+iFKqS4LFINDk=; b=wkBMviuk1cm1UN6ifJQVsNweUCYGdu6U2lONziYp752DIuZ6Q40hfec6Wom4fHS3MN itabNdTe2imgGCeTVGDpvlk29q685uz7dG//JgXf4D4JuYGqyFsrXwRdb3hURituo5GS EBE9DCfWZTGKlyr2Cmv5BF5muBTUDhA1Gtd6EOZ37iHUTk45eoZDMh8ZeCxXOnR/pD77 Kbjxp+BeVay8r067J17FCaQ4o6lb0f0X+Refp16VPycx0hGarwPcsu61db8pb3xrYnkw Sk2jJkUt7+ciKFa0bGy2IO9pzK180M95kXxkej8c5WR0yKq8ZCfCWW5RepkL618csapo yd0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mqgIqLbw; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e6-20020a170906248600b006d6dd9c1311si481716ejb.448.2022.02.28.09.30.18; Mon, 28 Feb 2022 09:30:41 -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=@kernel.org header.s=k20201202 header.b=mqgIqLbw; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235856AbiB1Lfz (ORCPT + 99 others); Mon, 28 Feb 2022 06:35:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51810 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231419AbiB1Lfw (ORCPT ); Mon, 28 Feb 2022 06:35:52 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2671170F50; Mon, 28 Feb 2022 03:35:13 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id B9A0060FE9; Mon, 28 Feb 2022 11:35:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 213E3C340EE; Mon, 28 Feb 2022 11:35:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1646048112; bh=VpTjIs0hzrsh4I+aITjeOAjdM8laTn+iFKqS4LFINDk=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=mqgIqLbwn4DE7AUflvIxC2VCB0cBn04sKV3turceRE7FJxkvalo/Ps8mQOvPkaIPi onbBtSjuukfUeezamG9+N3d2q31NSR0OIcGmIIgooQPqALYvdNwZdYS4QNprwy0f1P dqvW19r2tUVjJozQc2aQpbthWqbrUeV0X/9cdI2J5gZwCfqrMKZiUmBxrp7VD/xwq8 r37BFg1rfm/7mOxfT5QeX7dRCm9epHLXYbVGnE3MmxsbFVC6KmL/P2L2wUqmC2l950 NQGqk6f2NtJtpYOby2B5XjRqBmkIh/5ckagRgTorRyHWt0708tI+QrD8+6BR2lyXWr 1sfra8hptDKrA== Received: by mail-yw1-f178.google.com with SMTP id 00721157ae682-2d6923bca1aso104357787b3.9; Mon, 28 Feb 2022 03:35:12 -0800 (PST) X-Gm-Message-State: AOAM53132M4C3SyRs58icHc/oH631bzuitDzcW06idzgYOJL7lCSGwF9 ZcdeQomRHuxKtpPrrrLdY/w6cSBo3Dg/zUJYoAc= X-Received: by 2002:a0d:d482:0:b0:2d8:1555:e21d with SMTP id w124-20020a0dd482000000b002d81555e21dmr17717213ywd.272.1646048111201; Mon, 28 Feb 2022 03:35:11 -0800 (PST) MIME-Version: 1.0 References: <20220226110338.77547-1-chenhuacai@loongson.cn> <20220226110338.77547-10-chenhuacai@loongson.cn> In-Reply-To: From: Ard Biesheuvel Date: Mon, 28 Feb 2022 12:35:00 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH V6 09/22] LoongArch: Add boot and setup routines To: Arnd Bergmann Cc: Huacai Chen , Greg Kroah-Hartman , Huacai Chen , "Rafael J. Wysocki" , Len Brown , Andy Lutomirski , Thomas Gleixner , Peter Zijlstra , Andrew Morton , David Airlie , Jonathan Corbet , Linus Torvalds , linux-arch , Linux Doc Mailing List , Linux Kernel Mailing List , Xuefeng Li , Yanteng Si , Jiaxun Yang , linux-efi Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 On Mon, 28 Feb 2022 at 12:24, Arnd Bergmann wrote: > > On Mon, Feb 28, 2022 at 11:42 AM Huacai Chen wrote: > > On Mon, Feb 28, 2022 at 4:52 PM Ard Biesheuvel wrote: > > > On Mon, 28 Feb 2022 at 09:38, Huacai Chen wrote: > > > > > > > > > > RISC-V is a useful reference for the changes needed - this is the most > > > > > recent addition to the EFI stub, and avoids some legacy stuff that new > > > > > architectures have no need for. > > > > We still want to support the raw elf kernel (RISC-V also does), > > > > because LoongArch also has MCU and SoC and we want to support FDT (I > > > > think this is reasonable, because RISC-V also supports raw elf). > > > > > > > > > > That is fine. So perhaps the best course of action is to omit the > > > UEFI/ACPI parts entirely for now, and focus on the DT/embedded use > > > case. Once all the spec pieces are in place, the UEFI + ACPI changes > > > can be presented as a single coherent set. > > It seems that I made you confusing. :) > > There are big CPUs and small CPUs (MCU and SoC), big CPUs use > > UEFI+ACPI, while small CPUs use FDT. > > At present, the only matured LoongArch CPU is Loongson-3A5000 (big > > CPU) which uses UEFI+ACPI. > > We want to support raw elf because it can run on both ACPI firmware > > and FDT firmware, but at present we only have ACPI firmware. > > Can't you just use the UEFI protocol for kernel entry regardless > of the bootloader? It seems odd to use a different protocol for loading > grub and the kernel, especially if that means you end up having to > support both protocols inside of u-boot and grub, in order to chain-load > a uefi application like grub. > I think this would make sense. Now that the EFI stub has generic support for loading the initrd via a UEFI specific protocol (of which u-boot already carries an implementation), booting via UEFI only would mean that no Linux boot protocol would need to be defined outside of the kernel at all (i.e., where to load the kernel, where to put the command line, where to put the initrd, other arch specific rules etc etc) UEFI already supports both ACPI and DT boot