From patchwork Mon Jun 18 15:23:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 139014 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp4089272lji; Mon, 18 Jun 2018 08:31:13 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJWmdwCLlMZVIFlHh5e37RKAt3iY22XiGhfVsurW/SJUsGCxftueUaONXZY32WCQlNDa4NG X-Received: by 2002:a50:ec94:: with SMTP id e20-v6mr11655101edr.119.1529335873032; Mon, 18 Jun 2018 08:31:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529335873; cv=none; d=google.com; s=arc-20160816; b=l7RJ+miAmwNbtQFGsgqc47DfFTXFL0COOgcKQLHBDS4DYovm6WSd138ImFL1Mk9gcG 8G9eG/j2mngP+EarPw4BOAsAY4AJPMFoMLYxPahd04UWIFy50A27Cd6PV/zedoPpSjPe g/sBBOVGsPR7YAStOGSwosOQZlfATkPw/AW36ar2h0mnQo/ZjQHvQKANPY3jyHbLPa+D wLQWNDPYJ3XEBfqJvwBiDGjry173efIoAr95HdNXM9xwL+QoXyxgzNxdXuUbNij4Z7+Z wR28sodQ2NguYGD8OZcr+6CHPMd0WlmwnIlXuMLVcwBwHve15MMel1LXFNVEFVsx6GTC ZZKA== 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=AW7Al+gkyqpwpIYH/N8u5mlS4FXvJ+xIo3O9/dUbmnY=; b=C5cdAwdSsc7fWA/J63by0KJer3zbch6shC3NLi4WJGzAzUqIOiAcs5rXXaCwQmzvxV UfoDFWWL7Vtu6X7kRATa/SsPJdaDbN34O2y2lkRSFSHlQSDGkNnpmtvnxvrInJHV7XwE eE+tKd6zHieIrPLvmz5TKZ10K66jwdA3w8UV3ktDTpLPl0OmsB/oAOYfdQ3/Q1Auj+y2 GwrKEvePyNzjvWn2A2T7NRl8dkndEZRuwc/qHQTEEQbn0DMvVxj4KJWIzwCc9smwEsth 1LMJB5hmdRmypXWcQtNHdChGHPOenbQKDv92WjIKNp+tGhkXRf2XiL/Cs81lTSmRE8DL Tsjw== 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 t38-v6si5624382edd.288.2018.06.18.08.31.12; Mon, 18 Jun 2018 08:31:13 -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 920C0C21F0F; Mon, 18 Jun 2018 15:29:37 +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 1111EC21F84; Mon, 18 Jun 2018 15:23:44 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 268BFC21F2F; Mon, 18 Jun 2018 15:23:20 +0000 (UTC) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by lists.denx.de (Postfix) with ESMTPS id EFAF9C21E52 for ; Mon, 18 Jun 2018 15:23:17 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext-too.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 440F1AF79; Mon, 18 Jun 2018 15:23:17 +0000 (UTC) From: Alexander Graf To: u-boot@lists.denx.de Date: Mon, 18 Jun 2018 17:23:07 +0200 Message-Id: <20180618152315.34233-14-agraf@suse.de> X-Mailer: git-send-email 2.12.3 In-Reply-To: <20180618152315.34233-1-agraf@suse.de> References: <20180618152315.34233-1-agraf@suse.de> Cc: Heinrich Schuchardt , Andy Shevchenko Subject: [U-Boot] [PATCH v4 13/21] 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 --- v3 -> v4: - Compile fix for dts --- include/config_distro_bootcmd.h | 30 +++++++++++------------------- 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/include/config_distro_bootcmd.h b/include/config_distro_bootcmd.h index 1bd79ae3b8..c35a42f6c5 100644 --- a/include/config_distro_bootcmd.h +++ b/include/config_distro_bootcmd.h @@ -245,35 +245,27 @@ #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" +#elif defined(__ASSEMBLY__) +#define BOOTENV_EFI_PXE_ARCH "0xff" +#define BOOTENV_EFI_PXE_VCI "PXEClient:Arch:00255:UNDI:003000" #else #error Please specify an EFI client identifier #endif