From patchwork Fri Jun 22 12:44:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 139619 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp835328lji; Fri, 22 Jun 2018 05:50:43 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKuJKfcB7df697PdG34hrY+Um/wHuPhQZCxkqRkGoc0wkpfvPJMABmwUc8gArd77nyKBEMB X-Received: by 2002:aa7:d84a:: with SMTP id f10-v6mr1734229eds.157.1529671843720; Fri, 22 Jun 2018 05:50:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529671843; cv=none; d=google.com; s=arc-20160816; b=BGyWl5VNJ7UlmsRy1JvfDVvjX/O/CMrU4BIfxtKl3m57x+m18wX2SVkkrPkam8LrhC wUo5FZKvmLEw7R9Gpc7+XYzcZRPfusvuPP2ted2BiuneKKuujM1Iavz7osv4NEtiP4zU l+hFZpce4U56vuL0Tp6jJW/LAChNp0F71yQFFtcXBs5Chia1jxQzpYNEvF5lnCCAs8JG mJBk3RtIQNQbkbgcd2Ph4mM/ABfHClGQTKopF71GvckU83KaVf1JTQWsuUoSCeL9pnRL kyYQgBGb5HPlYISsY0hwcycS9s2dyg6XTxqHchR4mNWw0/chTSx/W/rqg9ThsBbj6MKX eP+w== 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=iP9fUUjIDZePizS10Wo6GRWdg1jSpA3KBHt+Vv/9Ob8=; b=S9j4p47z2SiYlVemDevdog/DU4e5br5Gc5YgstHS529V171I6Mw5DE5IWIVyjbshCL H0TWZNA7Gmww9x8wqSzuzTdxVbEmRUBqnMtwRcO8GXmO5X1OBu4mS+GYt7/Ir0H/Cdqv w2tUBzeBfpOrIFpy1Mmk0cnWW76YLN8B7auxJLGRDpYdDPmmh0InPd1FCgNeNFm9rron VhvW4/B99Ty1+czFY6srUiqrChbw4euAWJ7nnbf2M5Hkd+vVJzQn6IybFBR18/BD2IYq nswR1XTOxcnMKO1LBvtKCdP086uYuYpznqgnJOK8u7ZU1xh93+KrM7Ai2q7hOR2QmVUk MzxQ== 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 y5-v6si3667477edr.193.2018.06.22.05.50.43; Fri, 22 Jun 2018 05:50:43 -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 4C0BAC21F2A; Fri, 22 Jun 2018 12:47:26 +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 C3096C22093; Fri, 22 Jun 2018 12:44:30 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id CE270C21C2C; Fri, 22 Jun 2018 12:44:21 +0000 (UTC) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by lists.denx.de (Postfix) with ESMTPS id B0030C21E42 for ; Fri, 22 Jun 2018 12:44:20 +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 D1C7CADD1; Fri, 22 Jun 2018 12:44:19 +0000 (UTC) From: Alexander Graf To: u-boot@lists.denx.de Date: Fri, 22 Jun 2018 14:44:10 +0200 Message-Id: <20180622124418.52892-3-agraf@suse.de> X-Mailer: git-send-email 2.12.3 In-Reply-To: <20180622124418.52892-1-agraf@suse.de> References: <20180622124418.52892-1-agraf@suse.de> Cc: Heinrich Schuchardt , Andy Shevchenko Subject: [U-Boot] [PATCH v5 02/10] 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 | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/include/config_distro_bootcmd.h b/include/config_distro_bootcmd.h index d672e8ebe6..c35a42f6c5 100644 --- a/include/config_distro_bootcmd.h +++ b/include/config_distro_bootcmd.h @@ -245,22 +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" -#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(__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