From patchwork Wed Sep 25 14:56:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1167393 X-Patchwork-Delegate: bmeng.cn@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="K9deamTz"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 46dhnQ6Bh3z9sP3 for ; Thu, 26 Sep 2019 01:29:46 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 83EC0C220A0; Wed, 25 Sep 2019 15:19:51 +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=RCVD_IN_MSPIKE_H2, T_DKIM_INVALID 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 D2F93C2217F; Wed, 25 Sep 2019 15:02:47 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 7478CC22071; Wed, 25 Sep 2019 15:02:45 +0000 (UTC) Received: from mail-io1-f66.google.com (mail-io1-f66.google.com [209.85.166.66]) by lists.denx.de (Postfix) with ESMTPS id 5291FC22088 for ; Wed, 25 Sep 2019 14:58:40 +0000 (UTC) Received: by mail-io1-f66.google.com with SMTP id h144so14594096iof.7 for ; Wed, 25 Sep 2019 07:58:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=mWOyVH96LqljnxbajPYi0DD2YhDdHG8h6F4HkmeVSCU=; b=K9deamTz48k6ULrGUyuc2gPS8BB5Wecj79aOFPuPCTS8X25X4hpjZq5I/L5yTKreFz anEdCXT4cQAvcd1BASTpm7H1I+HUU9DwVDEULV5mUUEBpNAP+irSJza68o3q9DxeVnBS xjztTYuNjWKNLuD5dttx9p4mBuuHflxPo6A/8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=mWOyVH96LqljnxbajPYi0DD2YhDdHG8h6F4HkmeVSCU=; b=TNPoXovRQfaR1pyX+lJuTNylA5zalPi9fu4lYMLBrXq11RvoZcEyBBiByyhGAtlmOZ +m/Rkafcz7q/wrH77aQJkbcIiMXFoGbYn+K539brSRdbadIzu1burUpIngCWPx3K2ToK sHRLhMrsuvGXcaJEVLU6VCCk6gtFCizxkbj5GhCL9ntmTxgGUWxJ5avJEv7GWHt0BG6E kAZa0IN/MpIG/ES1yIXnXVDr29bD7AwwGl4Fyjyjt5ismRwGnL93aLOoccUcK9TD1/wC dzioZaBzjmtFZNMk4uNbrBYTglEyOcneHaubu+8f5LyfQ9LQDuvEb0N5erDBraanlxyF LknA== X-Gm-Message-State: APjAAAUqTaAE2s05IuQXRAYhkfUDBqN9LUg1ctMtlKS0+eitHvfXE8ed /dfxEag+sL2vzbnGmSUCuGi0sk5eXEw= X-Google-Smtp-Source: APXvYqzmsAxRxSZboqUq3W+hxVHqHRBagQLUf3EFz5JAPjhs//J9+u3tLZ+fuki86cTQWqfhQXVfqw== X-Received: by 2002:a5d:8247:: with SMTP id n7mr5300146ioo.35.1569423519122; Wed, 25 Sep 2019 07:58:39 -0700 (PDT) Received: from kiwi.bld.corp.google.com ([2620:15c:183:0:8223:87c:a681:66aa]) by smtp.gmail.com with ESMTPSA id d9sm4254964ioq.9.2019.09.25.07.58.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Sep 2019 07:58:38 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Date: Wed, 25 Sep 2019 08:56:28 -0600 Message-Id: <20190925145750.200592-45-sjg@chromium.org> X-Mailer: git-send-email 2.23.0.444.g18eeb5a265-goog In-Reply-To: <20190925145750.200592-1-sjg@chromium.org> References: <20190925145750.200592-1-sjg@chromium.org> MIME-Version: 1.0 Subject: [U-Boot] [PATCH 044/126] spl: Convert CONFIG_SPL_LIMIT to hex 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: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" This is currently a decimal value which is not as convenient or meaningful. Also U-Boot tends to use hex everywhere. Convert this option to hex and add a comment for the size_check macro. Signed-off-by: Simon Glass Reviewed-by: Simon Goldschmidt Acked-by: Bin Meng --- Makefile | 10 +++++++--- arch/arm/mach-socfpga/Kconfig | 2 +- common/spl/Kconfig | 2 +- configs/evb-rk3288_defconfig | 2 +- configs/tinker-rk3288_defconfig | 2 +- 5 files changed, 11 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index fd390e19458..a7a48b6aef3 100644 --- a/Makefile +++ b/Makefile @@ -337,14 +337,18 @@ endif # KBUILD_MODULES := 1 #endif +# Check ths size of a binary: +# Args: +# $1: File to check +# #2: Size limit in bytes (decimal or 0xhex) define size_check actual=$$( wc -c $1 | awk '{print $$1}'); \ limit=$$( printf "%d" $2 ); \ if test $$actual -gt $$limit; then \ echo "$1 exceeds file size limit:" >&2; \ - echo " limit: $$limit bytes" >&2; \ - echo " actual: $$actual bytes" >&2; \ - echo " excess: $$((actual - limit)) bytes" >&2; \ + echo " limit: $$(printf %#x bytes $$limit) bytes" >&2; \ + echo " actual: $$(printf %#x $$actual) bytes" >&2; \ + echo " excess: $$(printf %#x $$((actual - limit))) bytes" >&2;\ exit 1; \ fi endef diff --git a/arch/arm/mach-socfpga/Kconfig b/arch/arm/mach-socfpga/Kconfig index ee79953fcc2..45de153aa5a 100644 --- a/arch/arm/mach-socfpga/Kconfig +++ b/arch/arm/mach-socfpga/Kconfig @@ -4,7 +4,7 @@ config NR_DRAM_BANKS default 1 config SPL_SIZE_LIMIT - default 65536 if TARGET_SOCFPGA_GEN5 + default 0x10000 if TARGET_SOCFPGA_GEN5 config SPL_SIZE_LIMIT_PROVIDE_STACK default 0x200 if TARGET_SOCFPGA_GEN5 diff --git a/common/spl/Kconfig b/common/spl/Kconfig index 048b85ba7a2..ef4fb19e52c 100644 --- a/common/spl/Kconfig +++ b/common/spl/Kconfig @@ -26,7 +26,7 @@ config SPL_FRAMEWORK and the Linux Kernel. If unsure, say Y. config SPL_SIZE_LIMIT - int "Maximum size of SPL image" + hex "Maximum size of SPL image" depends on SPL default 69632 if ARCH_MX6 default 0 diff --git a/configs/evb-rk3288_defconfig b/configs/evb-rk3288_defconfig index 7b0e908f715..043ee32bb44 100644 --- a/configs/evb-rk3288_defconfig +++ b/configs/evb-rk3288_defconfig @@ -4,7 +4,7 @@ CONFIG_SYS_TEXT_BASE=0x01000000 CONFIG_ROCKCHIP_RK3288=y CONFIG_TARGET_EVB_RK3288=y CONFIG_NR_DRAM_BANKS=1 -CONFIG_SPL_SIZE_LIMIT=307200 +CONFIG_SPL_SIZE_LIMIT=0x4b000 CONFIG_SPL_STACK_R_ADDR=0x80000 CONFIG_DEBUG_UART_BASE=0xff690000 CONFIG_DEBUG_UART_CLOCK=24000000 diff --git a/configs/tinker-rk3288_defconfig b/configs/tinker-rk3288_defconfig index 93286084525..eff3b06b5ce 100644 --- a/configs/tinker-rk3288_defconfig +++ b/configs/tinker-rk3288_defconfig @@ -5,7 +5,7 @@ CONFIG_SPL_GPIO_SUPPORT=y CONFIG_ROCKCHIP_RK3288=y CONFIG_TARGET_TINKER_RK3288=y CONFIG_NR_DRAM_BANKS=1 -CONFIG_SPL_SIZE_LIMIT=307200 +CONFIG_SPL_SIZE_LIMIT=0x4b000 CONFIG_SPL_STACK_R_ADDR=0x80000 CONFIG_DEBUG_UART_BASE=0xff690000 CONFIG_DEBUG_UART_CLOCK=24000000