From patchwork Mon Jul 9 17:33:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leif Lindholm X-Patchwork-Id: 141475 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp2922913ljj; Mon, 9 Jul 2018 10:33:33 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeRAfOXsr4MJGUyjVlI+JF3HavAfhIlFqZNobOGOU5OlIFrsBFsHKmucJwLKxTUKMFZAaIh X-Received: by 2002:ac8:2c24:: with SMTP id d33-v6mr2594196qta.118.1531157612890; Mon, 09 Jul 2018 10:33:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531157612; cv=none; d=google.com; s=arc-20160816; b=faersR/fX7+N/YgS6Yw0ROzVuCET0o9T37O6EMVOa2gearOCMBokbXnIyrvqNxCa0H A6UnVCoFB9vi415CQ+IOcPvWBlu+YSYowU4Ms2aKck1R7l35pIObNZMSqedk/Ye1f6z0 Bm1YhIjfSikojclDX7KgUfT4ikn+YbNRVaRzd0ms41B4XJ31+ahsdNcVVe3jBsORgAvr aBJRZ0nXV+2M85Amextxx48NAPst8MO6QeP0KLY7CWnABG7NNx4FhR6GAKRzsnEwGMHz k6bClE/2hhAHgx0Ye5H1HHCZDA620fh/ZWJHeD9GYflx3MqUgozvxE6nHExXq4NYHuQB OKkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:references:in-reply-to:message-id:date:subject :to:from:dkim-signature:arc-authentication-results; bh=9qgiUTAoCSz/euL6+6XEnTGiLKZmZqB69/63QwGp+FE=; b=IXcgMBtgQqUs83Pnrymvq4usqTA8I7O2P5WhwKgyJQopLAWblz+tTLzfAafaPjzXL9 MUeHcKTqbjb/MHeTa8bvdcKEJSQjHMFBRFRC5bT0gPDiN7BPgRWX0r/RSPHW9Wpd/1g5 bsOmTJpLXpYcsKq/4S5pyS6K7Kd6EX4POLkAD5rpg7soMPKbZmbU8JHVhyPu3jM3rTZO crCXD5kgV1xbyfHK4Vm/2u3YYls93VzjhrIq5sOMbtKb3dcMilgKfwAcZbcL5gw1/iVR RFM7PO/NGRiBRiSzgQJvXF7eKV+5YZ8HsJyTLDyRP+DeQ91dBm5GHpx9KB0vPmV09TpQ 4ATg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b="OEnv/rk1"; spf=pass (google.com: domain of grub-devel-bounces+patch=linaro.org@gnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="grub-devel-bounces+patch=linaro.org@gnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id s55-v6si109000qvc.259.2018.07.09.10.33.32 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 09 Jul 2018 10:33:32 -0700 (PDT) Received-SPF: pass (google.com: domain of grub-devel-bounces+patch=linaro.org@gnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b="OEnv/rk1"; spf=pass (google.com: domain of grub-devel-bounces+patch=linaro.org@gnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="grub-devel-bounces+patch=linaro.org@gnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:43609 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fca2W-0000MO-6T for patch@linaro.org; Mon, 09 Jul 2018 13:33:32 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44281) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fca2F-0000Js-PJ for grub-devel@gnu.org; Mon, 09 Jul 2018 13:33:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fca2E-0002hC-Ow for grub-devel@gnu.org; Mon, 09 Jul 2018 13:33:15 -0400 Received: from mail-wm0-x236.google.com ([2a00:1450:400c:c09::236]:39044) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fca2E-0002gq-Ij for grub-devel@gnu.org; Mon, 09 Jul 2018 13:33:14 -0400 Received: by mail-wm0-x236.google.com with SMTP id h20-v6so5691396wmb.4 for ; Mon, 09 Jul 2018 10:33:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=xDGlRpSaOOQ50Q0B5HRZ7Qljf02tkbpV7Dbe7rz6rh4=; b=OEnv/rk1XdrVARTvbbO6QtTPjTfa4YfpKjHTEAxqW2Oy8MLC18n4398G+AA4IVY09M 0EXs8rH0y8mMrP54B18086mndRso4butn9zCQN/NYIsu40oFp1uMxW0nAqPG+utsdCBN EedwOPZ4c6jmFoSwY4+BGMRZmMfNnyathrbIQ= 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:in-reply-to :references; bh=xDGlRpSaOOQ50Q0B5HRZ7Qljf02tkbpV7Dbe7rz6rh4=; b=osLuVlMsYDdtuv48PrZffGaYl3RPnA17nmgcoaZsi8psZp3sjuqjLYIGVscwVgm74y 9AI/a/nbz2MVwncJaLrzR+GC3yLhEQ4RrotizaPqIcWOvYqyBGH+I5Cse7uomDiTED/G 6xUNkIBnaozGHtn29vEHYqzc1pIPaW77ncYWucPchPh0/ylaQdbLSDCgPhtAmIM7uMkQ mohV9WH5lMl0zv4gPJ+FHNfX4+gj2Bl3vSlUue/GMEWYuAn+sFElBGWSzHI/o8sdbXWe F4Ywzwk76upIS33WnlD+LKsAomFZFdUFm7cgUJ/PAPflQLZxAQtuXwApdJ6fCRj4Vxbm LK8A== X-Gm-Message-State: APt69E04sZG2r3OpDuH/38f/TbwxwTuKPkCsOdmOO4C4i/2vOoGyTHrD d73zzK3V2GPi9/ZdUPAVE0dnGlI3rJY= X-Received: by 2002:a1c:3282:: with SMTP id y124-v6mr12331594wmy.11.1531157593281; Mon, 09 Jul 2018 10:33:13 -0700 (PDT) Received: from vanye.hemma.eciton.net (cpc92302-cmbg19-2-0-cust304.5-4.cable.virginm.net. [82.1.209.49]) by smtp.gmail.com with ESMTPSA id p3-v6sm27742988wrg.47.2018.07.09.10.33.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Jul 2018 10:33:12 -0700 (PDT) From: Leif Lindholm To: grub-devel@gnu.org Subject: [PATCH v4 4/6] arm/efi: switch to arm64 linux loader Date: Mon, 9 Jul 2018 18:33:03 +0100 Message-Id: <20180709173305.17588-5-leif.lindholm@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180709173305.17588-1-leif.lindholm@linaro.org> References: <20180709173305.17588-1-leif.lindholm@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::236 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: The development of GNU GRUB Cc: Daniel Kiper MIME-Version: 1.0 Errors-To: grub-devel-bounces+patch=linaro.org@gnu.org Sender: "Grub-devel" The arm64 and arm linux kernel EFI-stub support presents pretty much identical interfaces, so the same linux loader source can be used for both architectures. Switch 32-bit ARM UEFI platforms over to the existing EFI-stub aware loader initially developed for arm64. This *WILL* stop non-efistub Linux kernels from booting on arm-efi. Signed-off-by: Leif Lindholm --- grub-core/Makefile.core.def | 7 ++++--- grub-core/kern/efi/mm.c | 2 +- include/grub/arm/linux.h | 5 +++++ include/grub/efi/efi.h | 2 -- 4 files changed, 10 insertions(+), 6 deletions(-) -- 2.11.0 _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def index fc4767f19..9590e87d9 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def @@ -229,7 +229,6 @@ kernel = { ia64_efi = kern/ia64/cache.c; arm_efi = kern/arm/efi/init.c; - arm_efi = kern/arm/efi/misc.c; arm_efi = kern/efi/fdt.c; arm64_efi = kern/arm64/efi/init.c; @@ -1693,7 +1692,9 @@ module = { powerpc_ieee1275 = loader/powerpc/ieee1275/linux.c; sparc64_ieee1275 = loader/sparc64/ieee1275/linux.c; ia64_efi = loader/ia64/efi/linux.c; - arm = loader/arm/linux.c; + arm_coreboot = loader/arm/linux.c; + arm_efi = loader/arm64/linux.c; + arm_uboot = loader/arm/linux.c; arm64 = loader/arm64/linux.c; common = loader/linux.c; common = lib/cmdline.c; @@ -1702,7 +1703,7 @@ module = { module = { name = fdt; - arm64 = loader/efi/fdt.c; + efi = loader/efi/fdt.c; common = lib/fdt.c; enable = fdt; }; diff --git a/grub-core/kern/efi/mm.c b/grub-core/kern/efi/mm.c index b7cf144e5..f443b8955 100644 --- a/grub-core/kern/efi/mm.c +++ b/grub-core/kern/efi/mm.c @@ -630,7 +630,7 @@ grub_efi_mm_init (void) 2 * BYTES_TO_PAGES (MEMORY_MAP_SIZE)); } -#if defined (__aarch64__) +#if defined (__aarch64__) || defined (__arm__) grub_err_t grub_efi_get_ram_base(grub_addr_t *base_addr) { diff --git a/include/grub/arm/linux.h b/include/grub/arm/linux.h index cceb9c4a9..3d0d15eb4 100644 --- a/include/grub/arm/linux.h +++ b/include/grub/arm/linux.h @@ -34,6 +34,11 @@ struct linux_arm_kernel_header { grub_uint32_t hdr_offset; }; +#if defined(__arm__) +# define GRUB_LINUX_ARMXX_MAGIC_SIGNATURE GRUB_LINUX_ARM_MAGIC_SIGNATURE +# define linux_armxx_kernel_header linux_arm_kernel_header +#endif + #if defined GRUB_MACHINE_UBOOT # include # define LINUX_ADDRESS (start_of_ram + 0x8000) diff --git a/include/grub/efi/efi.h b/include/grub/efi/efi.h index 1deaa3c8f..2c6648d46 100644 --- a/include/grub/efi/efi.h +++ b/include/grub/efi/efi.h @@ -92,8 +92,6 @@ extern void (*EXPORT_VAR(grub_efi_net_config)) (grub_efi_handle_t hnd, #if defined(__arm__) || defined(__aarch64__) void *EXPORT_FUNC(grub_efi_get_firmware_fdt)(void); -#endif -#if defined(__aarch64__) grub_err_t EXPORT_FUNC(grub_efi_get_ram_base)(grub_addr_t *); #include grub_err_t grub_armxx_efi_linux_check_image(struct linux_armxx_kernel_header *lh);