From patchwork Fri Jun 15 12:42:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 138691 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp806588lji; Fri, 15 Jun 2018 05:52:10 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKH8aibB4eVGb+DUyk7cTLi2rii9Ly2wS/bD5XwfwzPyBeLxempt6eqEjUN3yxAVBDkxNzl X-Received: by 2002:a50:bf47:: with SMTP id g7-v6mr1756401edk.283.1529067130710; Fri, 15 Jun 2018 05:52:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529067130; cv=none; d=google.com; s=arc-20160816; b=AUoomM9DJW1nvksefmW+K/EPyaMVWhc9DjMUdZnTfmB52oNsDl6M/3NrFFxTaXHRdj M/mKLvzdPcuHjOjiNcxi/SpVNIELJUcDbrebKrZtYD/PRSMpD8gNy4jIBOVmo+7Aep65 CXeqirGaWRRMtTvl/sq7+3pm5V/8wygkyAJUADcNDfKYFOhhWackeREeii7ZsSt1Lyxh u8CCdIgBlZp/aRzqz4QDkKuZkO2ut6IKFHr2LFCyoY+zHOWbbvyx9zWC746p9HUfIZkz S0DrJI2miX1qnrCgAETSD8pYOJ65hfT5siI52YSUIyoYKZ6zJ6OrNC6j9u5cver5CeyE NXlw== 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 :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:references:in-reply-to:message-id :date:to:from:arc-authentication-results; bh=YXNBaSp4QswcgYbaS9sFIupPjxj36xuyyMYzxN+8Sl4=; b=KcVKiUALl7Wfj8hfvvZS1VzIiyG6YLVsGCyQfnak4exGdoALZLjzGsymWWZF+xKSfZ CY/g6BD3VOzDXVJqK369QM2i88I3gmVmlWvOLXLwZ4caLALYEvYJPm+4AlTo+1xmx86O y1qd5lmmwz09zg5LLtbok7s3wJBZdVMkrg91D2COw9i0RZQ4yXlPvSg1huJ6eyeaFrD9 AnGyMf3Aw2Rricr/mgBEVZiuFdZAdsaZyTE4rBEtNCJ+QX+PohCWb3RZuvSmawH00NXD YjhgpcR2A4ie7e/eDIPgvke9nvmJ9NPQqWIclO/cDYxAk+73KuqDCQEXKZvm3Rr9k8QC A5OA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id k1-v6si3232805edc.350.2018.06.15.05.52.10; Fri, 15 Jun 2018 05:52:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by lists.denx.de (Postfix, from userid 105) id 412E7C21EFD; Fri, 15 Jun 2018 12:47:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 52A32C21F2F; Fri, 15 Jun 2018 12:42:44 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id A1E39C21EA6; Fri, 15 Jun 2018 12:42:34 +0000 (UTC) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by lists.denx.de (Postfix) with ESMTPS id DBBE2C21EA6 for ; Fri, 15 Jun 2018 12:42:31 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext-too.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 45E0DAF90; Fri, 15 Jun 2018 12:42:31 +0000 (UTC) From: Alexander Graf To: u-boot@lists.denx.de Date: Fri, 15 Jun 2018 14:42:26 +0200 Message-Id: <20180615124229.35310-15-agraf@suse.de> X-Mailer: git-send-email 2.12.3 In-Reply-To: <20180615124229.35310-1-agraf@suse.de> References: <20180615124229.35310-1-agraf@suse.de> Cc: Andy Shevchenko , Heinrich Schuchardt Subject: [U-Boot] [PATCH v3 14/17] distro: Move to compiler based target architecture determination X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Thanks to CONFIG_SANDBOX, we can not rely on config options to tell us what CPU architecture we're running on. The compiler however does know that, so let's just move the ifdefs over to compiler based defines rather than kconfig based options. Signed-off-by: Alexander Graf --- include/config_distro_bootcmd.h | 27 ++++++++------------------- 1 file changed, 8 insertions(+), 19 deletions(-) diff --git a/include/config_distro_bootcmd.h b/include/config_distro_bootcmd.h index 1bd79ae3b8..ca6c57edbf 100644 --- a/include/config_distro_bootcmd.h +++ b/include/config_distro_bootcmd.h @@ -245,35 +245,24 @@ #if defined(CONFIG_CMD_DHCP) #if defined(CONFIG_EFI_LOADER) /* http://www.iana.org/assignments/dhcpv6-parameters/dhcpv6-parameters.xml */ -#if defined(CONFIG_ARM64) +#if defined(__aarch64__) #define BOOTENV_EFI_PXE_ARCH "0xb" #define BOOTENV_EFI_PXE_VCI "PXEClient:Arch:00011:UNDI:003000" -#elif defined(CONFIG_ARM) +#elif defined(__arm__) #define BOOTENV_EFI_PXE_ARCH "0xa" #define BOOTENV_EFI_PXE_VCI "PXEClient:Arch:00010:UNDI:003000" - -/* For sandbox we only support 64-bit x86 at present */ -#elif defined(CONFIG_X86) -/* Always assume we're running 64bit */ +#elif defined(__x86_64__) #define BOOTENV_EFI_PXE_ARCH "0x7" #define BOOTENV_EFI_PXE_VCI "PXEClient:Arch:00007:UNDI:003000" -#elif defined(CONFIG_CPU_RISCV_32) +#elif defined(__i386__) +#define BOOTENV_EFI_PXE_ARCH "0x0" +#define BOOTENV_EFI_PXE_VCI "PXEClient:Arch:00000:UNDI:003000" +#elif defined(__riscv) && (__riscv_xlen == 32) #define BOOTENV_EFI_PXE_ARCH "0x19" #define BOOTENV_EFI_PXE_VCI "PXEClient:Arch:00025:UNDI:003000" -#elif defined(CONFIG_CPU_RISCV_64) +#elif defined(__riscv) && (__riscv_xlen == 64) #define BOOTENV_EFI_PXE_ARCH "0x1b" #define BOOTENV_EFI_PXE_VCI "PXEClient:Arch:00027:UNDI:003000" -#elif defined(CONFIG_SANDBOX) -/* - * TODO(sjg@chromium.org): Consider providing a way to enable sandbox features - * based on the host architecture - */ -# ifndef __x86_64__ -# warning "sandbox EFI support is only tested on 64-bit x86" -# endif -/* To support other *host* architectures this should be changed */ -#define BOOTENV_EFI_PXE_ARCH "0x7" -#define BOOTENV_EFI_PXE_VCI "PXEClient:Arch:00007:UNDI:003000" #else #error Please specify an EFI client identifier #endif