From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CACCBC77B61 for ; Thu, 27 Apr 2023 09:19:58 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 826778629C; Thu, 27 Apr 2023 11:19:56 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=collabora.com 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=collabora.com header.i=@collabora.com header.b="HB5SOavg"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 370AA85723; Thu, 27 Apr 2023 11:19:55 +0200 (CEST) Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 78DD6862A0 for ; Thu, 27 Apr 2023 11:19:52 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=eugen.hristev@collabora.com Received: from [192.168.0.125] (unknown [82.76.24.202]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: ehristev) by madras.collabora.co.uk (Postfix) with ESMTPSA id 983E56603280; Thu, 27 Apr 2023 10:19:51 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1682587192; bh=iT/zSUQ3DCAa8R3a3f6b/cVGOnxcQkYgsHboYFZ7Tbg=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=HB5SOavgs+akkyEj0k8n1fScE7kVtqdAA2g9VZldqSVAXIb7UGldukm3yaN4Y9Uec mr7ZAZ1pqHN0BC3FadwGO0+j+6r9KvY1PKLRafe73gxJjnb4ViGX8ujZGsXkN5t0sz TKKcUlM6ejhiQ3PM+nht0y2WNvZkCymKaXoKXXCHeF0qFmGy6Pg7PaA7mfGmX0noLu dRousvudBTgk3JOTwFNNrW0wEYBEtI96+rp39EsK00tW98SDzDGBTAcXJllIBu1mOp u8D6kR+GmL0/dCRVxJ7oCu9BriJ9nQi/rIjSp4/HOG3LVO2Kgmx0DDKeot0vxR/mOr XMu0iFTszg2qA== Message-ID: Date: Thu, 27 Apr 2023 12:19:49 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH] configs: at91: sama5d2_icp_mmc: Enable CONFIG_LTO Content-Language: en-US To: Stefan Roese , u-boot@lists.denx.de Cc: Eugen Hristev , =?UTF-8?Q?Pali_Roh=c3=a1r?= , Nicolas Ferre , cristian.birsan@microchip.com References: <20230427085945.475619-1-sr@denx.de> From: Eugen Hristev In-Reply-To: <20230427085945.475619-1-sr@denx.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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.8 at phobos.denx.de X-Virus-Status: Clean Hi Stefan, Thank you for the patch. This I guess is a workaround such that you can add a bit more of code. In the end, it's not scalable, and we have to find a better way, probably by removing some of the code to make the SPL smaller. How does this impact the size? How much we are gaining ? We can perhaps have a look to see which code is removed and guard it by #ifndef SPL_BUILD and that might lower the size. (if ofcourse, this code should really be removed) Also, I don't have a board at hand to test this, so it has to be tested first to make sure the board doesn't break. Eugen On 4/27/23 11:59, Stefan Roese wrote: > Adding just a tiny bit more code for sama5d2_icp_mmc leads to a SRAM > image overflow. Fix this by enabling LTO for this board, so that such > changes still can be made to the common U-Boot code. > > Signed-off-by: Stefan Roese > Cc: Tudor Ambarus > Cc: Eugen Hristev > Cc: Sergiu Moga > Cc: Pali Rohár > --- > configs/sama5d2_icp_mmc_defconfig | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/configs/sama5d2_icp_mmc_defconfig b/configs/sama5d2_icp_mmc_defconfig > index e1b602d8e5ec..a3c57a3f1250 100644 > --- a/configs/sama5d2_icp_mmc_defconfig > +++ b/configs/sama5d2_icp_mmc_defconfig > @@ -9,9 +9,11 @@ CONFIG_SPL_LIBCOMMON_SUPPORT=y > CONFIG_SPL_LIBGENERIC_SUPPORT=y > CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y > CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x20003ef0 > +CONFIG_SF_DEFAULT_SPEED=66000000 > CONFIG_ENV_SIZE=0x4000 > CONFIG_DM_GPIO=y > CONFIG_DEFAULT_DEVICE_TREE="at91-sama5d2_icp" > +CONFIG_OF_LIBFDT_OVERLAY=y > CONFIG_SPL_MMC=y > CONFIG_SPL_SERIAL=y > CONFIG_SPL_DRIVERS_MISC=y > @@ -24,6 +26,7 @@ CONFIG_SPL_FS_FAT=y > CONFIG_SPL_LIBDISK_SUPPORT=y > CONFIG_SYS_LOAD_ADDR=0x22000000 > CONFIG_DEBUG_UART=y > +CONFIG_LTO=y > CONFIG_ENV_VARS_UBOOT_CONFIG=y > CONFIG_SYS_MONITOR_LEN=524288 > CONFIG_FIT=y > @@ -86,7 +89,6 @@ CONFIG_MMC_SDHCI=y > CONFIG_MMC_SDHCI_ATMEL=y > CONFIG_DM_SPI_FLASH=y > CONFIG_SF_DEFAULT_BUS=2 > -CONFIG_SF_DEFAULT_SPEED=66000000 > CONFIG_SPI_FLASH_SFDP_SUPPORT=y > CONFIG_SPI_FLASH_ATMEL=y > CONFIG_SPI_FLASH_MACRONIX=y > @@ -110,5 +112,4 @@ CONFIG_TIMER=y > CONFIG_SPL_TIMER=y > CONFIG_ATMEL_TCB_TIMER=y > CONFIG_SPL_ATMEL_TCB_TIMER=y > -CONFIG_OF_LIBFDT_OVERLAY=y > # CONFIG_EFI_LOADER_HII is not set