From patchwork Thu Jun 2 13:57:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 1638368 X-Patchwork-Delegate: monstr@monstr.eu Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=monstr-eu.20210112.gappssmtp.com header.i=@monstr-eu.20210112.gappssmtp.com header.a=rsa-sha256 header.s=20210112 header.b=MxzXAuwH; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LDSMb0XBVz9sFr for ; Fri, 3 Jun 2022 00:00:26 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 017FF8439A; Thu, 2 Jun 2022 15:59:15 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=monstr.eu Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=monstr-eu.20210112.gappssmtp.com header.i=@monstr-eu.20210112.gappssmtp.com header.b="MxzXAuwH"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8C0718432C; Thu, 2 Jun 2022 15:58:14 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ed1-x531.google.com (mail-ed1-x531.google.com [IPv6:2a00:1450:4864:20::531]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 90ED680179 for ; Thu, 2 Jun 2022 15:58:06 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=monstr.eu Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=monstr@monstr.eu Received: by mail-ed1-x531.google.com with SMTP id fd25so6386120edb.3 for ; Thu, 02 Jun 2022 06:58:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monstr-eu.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=hWBseo48M6XffmloE6aEmcd6yt1V94Nx3Bt3PsczHfE=; b=MxzXAuwHffpuAS8433f93IUQS3wu72dgaSKQceA0hAgzVTYdG3v4csnxQYwTlPy71P ZmPL0SrbKCRds7mfMTbLFC9O8/yCQCBjbX3QKCCT+vQTVXJ+gPwDK1IqgDHxSXbe1ZNF GOayoiomMPRV2iawt7H1AbHiHZIh7Und2Nmktw0vktopBwRLrBVYJfchpEScES0sb+Z1 tYAcICtnHRypAflDhpudf6KNiZkoO7s2cbgx3DxCGfwaXuK1FjgudxFgMyX5b2yZUmAe bpEsQnLiy2Cw93b3fjo8osvaFh4ryec5Nn3eXcriCE8w40P2gscfTGgWlu57KbeR4SZk NkBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=hWBseo48M6XffmloE6aEmcd6yt1V94Nx3Bt3PsczHfE=; b=JYwNwZ+CJQyxYdYgdZblbv6EYyXHc3nuFcUph0WeOq447kqGxCrxWefu6hxSrJ8Vvj BNpwEWn09tmQFKBwjP+ZQ5YsRvm1cI4cTpDxT9D+nyFGOMgxZaLu4rAcYAN8aMX97Nua ekZJ+DtRHD5qtF+BvwjzDWTKdIZrGwunuIMCdtzzJoEsHy8xqkREZTYSY/KJHWabDUdQ BTrGgSpqxWv4dCGyvCh783W+A3h7PsXSrXBrranJxVNUP7yVs/IBMlnFFU5Reps/gtXK E1ZDu6WaUp17dnRS+MQwMGZhqql6NPbuc2HMEFvXqt21xZ/XwwAYDNcPkve8/lb9Z+e3 mGzA== X-Gm-Message-State: AOAM531Op8XcWUNvki+EEYGZvYyW9QE379GgfHnVMOYm91vUWZFRRhew HsX+r6nlwBeHKSr3YIctl8hOps6fttGKeQ== X-Google-Smtp-Source: ABdhPJz+J1RD0TRSvHlqJVLVg17MtG+XukvQV6lkc8PzrQ86JlBBvOfOdtiBT0kujd2ugwUDA58Lkw== X-Received: by 2002:a05:6402:2548:b0:42d:dd95:5bfe with SMTP id l8-20020a056402254800b0042ddd955bfemr5576299edb.285.1654178286128; Thu, 02 Jun 2022 06:58:06 -0700 (PDT) Received: from localhost ([2a02:768:2307:40d6::f9e]) by smtp.gmail.com with ESMTPSA id p19-20020a056402155300b0042617ba638esm2510181edx.24.2022.06.02.06.58.05 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 02 Jun 2022 06:58:05 -0700 (PDT) From: Michal Simek X-Google-Original-From: Michal Simek To: u-boot@lists.denx.de, git@xilinx.com Cc: Michal Simek Subject: [PATCH 10/22] microblaze: Enable REMAKE_ELF Date: Thu, 2 Jun 2022 15:57:34 +0200 Message-Id: <26af8d7195c86b4535bbabfbb460085580e763b0.1654178252.git.michal.simek@amd.com> X-Mailer: git-send-email 2.36.0 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean Enable u-boot.elf recreation from u-boot.bin to prepare for removing manul relocation. Enable option for big endian configuration but it is not used too much that's why it is completely untested. By supporting this system there is a need to define LITTLE/BIG endian Kconfig options to pass -EL/-EB flags. Full command line for u-boot.elf recreation looks like this: microblazeel-xilinx-linux-gnu-objcopy -I binary -B microblaze \ -O elf32-microblazeel u-boot.bin u-boot-elf.o Signed-off-by: Michal Simek --- There are two Kconfig warnings and don't know how to fix it now. arch/mips/Kconfig:192:warning: choice value used outside its choice group arch/mips/Kconfig:196:warning: choice value used outside its choice group --- arch/microblaze/Kconfig | 16 ++++++++++++++++ arch/microblaze/config.mk | 6 ++++++ configs/microblaze-generic_defconfig | 1 + 3 files changed, 23 insertions(+) diff --git a/arch/microblaze/Kconfig b/arch/microblaze/Kconfig index d7d1b219704e..f1fc46e774e5 100644 --- a/arch/microblaze/Kconfig +++ b/arch/microblaze/Kconfig @@ -4,6 +4,22 @@ menu "MicroBlaze architecture" config SYS_ARCH default "microblaze" +# Endianness selection +choice + prompt "Endianness selection" + default SYS_LITTLE_ENDIAN + help + Microblaze architectures can be configured for either little or + big endian formats. Be sure to select the appropriate mode. + +config SYS_BIG_ENDIAN + bool "Big endian" + +config SYS_LITTLE_ENDIAN + bool "Little endian" + +endchoice + choice prompt "Target select" optional diff --git a/arch/microblaze/config.mk b/arch/microblaze/config.mk index de5b97e719cc..3e84a832fc12 100644 --- a/arch/microblaze/config.mk +++ b/arch/microblaze/config.mk @@ -16,3 +16,9 @@ LDFLAGS_FINAL += --gc-sections ifeq ($(CONFIG_SPL_BUILD),) PLATFORM_CPPFLAGS += -fPIC endif + +ifeq ($(CONFIG_SYS_LITTLE_ENDIAN),y) +PLATFORM_ELFFLAGS += -B microblaze $(OBJCOPYFLAGS) -O elf32-microblazeel +else +PLATFORM_ELFFLAGS += -B microblaze $(OBJCOPYFLAGS) -O elf32-microblaze +endif diff --git a/configs/microblaze-generic_defconfig b/configs/microblaze-generic_defconfig index c0f5d4c9a1cf..c2d25ea460b2 100644 --- a/configs/microblaze-generic_defconfig +++ b/configs/microblaze-generic_defconfig @@ -18,6 +18,7 @@ CONFIG_XILINX_MICROBLAZE0_USE_DIV=1 CONFIG_XILINX_MICROBLAZE0_USE_HW_MUL=2 CONFIG_DEBUG_UART=y CONFIG_DISTRO_DEFAULTS=y +CONFIG_REMAKE_ELF=y CONFIG_FIT=y CONFIG_FIT_VERBOSE=y CONFIG_BOOTDELAY=-1