public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Wolfgang Denk <wd@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] Enable expression support for CONFIG_BOARD_SIZE_LIMIT
Date: Wed, 05 Dec 2018 10:52:01 +0100	[thread overview]
Message-ID: <20181205095202.027A5242268@gemini.denx.de> (raw)
In-Reply-To: <CAOMZO5Co8KPCBx+gPS8w02cYJR2Ci9cpSKVQm3zy+JRgD1mtLw@mail.gmail.com>

Dear Fabio,

In message <CAOMZO5Co8KPCBx+gPS8w02cYJR2Ci9cpSKVQm3zy+JRgD1mtLw@mail.gmail.com> you wrote:
>
> Still not working for me. I do see a warning now:
>
>   LD      spl/u-boot-spl
> /bin/sh: 1: arithmetic expression: expecting primary: ""((768 - 69) * 1024)""
>   COPY    u-boot.bin
>   MKIMAGE u-boot.img
>   OBJCOPY spl/u-boot-spl-nodtb.bin
>   COPY    spl/u-boot-spl.bin
>   CFGS    spl/u-boot-spl.cfgout
>   MKIMAGE SPL
>   CFGCHK  u-boot.cfg

I'm bulding with your modification:

diff --git a/include/configs/pico-imx7d.h b/include/configs/pico-imx7d.h
index 2bc42a04a0..67ca700a2f 100644
--- a/include/configs/pico-imx7d.h
+++ b/include/configs/pico-imx7d.h
@@ -134,7 +134,8 @@
 /* FLASH and environment organization */
 #define CONFIG_ENV_SIZE                        SZ_8K

-#define CONFIG_ENV_OFFSET                      (8 * SZ_64K)
+#define CONFIG_ENV_OFFSET              (768 * 1024)
+#define CONFIG_BOARD_SIZE_LIMIT                ((768 - 69) * 1024)
 #define CONFIG_SYS_FSL_USDHC_NUM               2

 #define CONFIG_SYS_MMC_ENV_DEV                 0

...
  LD      spl/common/spl/built-in.o
  CC      spl/lib/display_options.o
  LD      spl/lib/built-in.o
  LD      spl/u-boot-spl
  OBJCOPY spl/u-boot-spl-nodtb.bin
  COPY    spl/u-boot-spl.bin
  MKIMAGE SPL
  OBJCOPY u-boot.srec
  OBJCOPY u-boot-nodtb.bin
  COPY    u-boot.bin
  SYM     u-boot.sym
  MKIMAGE u-boot.img
  CHK     include/config.h
  CFG     u-boot.cfg
===================== WARNING ======================
This board does not use CONFIG_DM_MMC. Please update
the board to use CONFIG_DM_MMC before the v2019.04 release.
Failure to update by the deadline may result in board removal.
See doc/driver-model/MIGRATION.txt for more info.
====================================================
===================== WARNING ======================
This board does not use CONFIG_DM_USB. Please update
the board to use CONFIG_DM_USB before the v2019.07 release.
Failure to update by the deadline may result in board removal.
See doc/driver-model/MIGRATION.txt for more info.
====================================================
  CFGCHK  u-boot.cfg


> It does allow the build to proceed, but it is not really detecting the
> overlap anymore.
>
> For example: let's force the overlap by setting a very small
> CONFIG_BOARD_SIZE_LIMIT of only 1K:
>
> #define CONFIG_ENV_OFFSET (768 * 1024)
> #define CONFIG_BOARD_SIZE_LIMIT (1 * 1024)

Please try it on the shell:

-> echo $(( ((768 - 69) * 1024) ))
715776
-> echo $(( (1 * 1024) ))
1024

> /bin/sh: 1: arithmetic expression: expecting primary: ""(1 * 1024)""

I tested this with /bin/bash, /bin/sh and even /bin/dash - they all
work fine here.

> It still allowed a successful build, but it should have thrown an
> error about the overlap.

It does for me, if I set the limit low:

  OBJCOPY spl/u-boot-spl-nodtb.bin
  COPY    spl/u-boot-spl.bin
  CFGS    spl/u-boot-spl.cfgout
  MKIMAGE SPL
  OBJCOPY u-boot.srec
  OBJCOPY u-boot-nodtb.bin
u-boot-nodtb.bin exceeds file size limit:
  limit:  1024 bytes
  actual: 480172 bytes
  excess: 479148 bytes
make: *** [Makefile:1071: u-boot-nodtb.bin] Error 1



Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The most exciting phrase to hear in science, the one that heralds new
discoveries, is not "Eureka!" (I found it!) but "That's funny ..."
                                                      -- Isaac Asimov

  reply	other threads:[~2018-12-05  9:52 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-30 14:52 [U-Boot] [PATCH v4] pico-imx7d: Increase the CONFIG_ENV_OFFSET size Fabio Estevam
2018-11-30 15:17 ` Otavio Salvador
2018-11-30 15:33 ` Wolfgang Denk
2018-11-30 16:28   ` Fabio Estevam
2018-12-03 15:52     ` Wolfgang Denk
2018-12-03 16:53       ` Fabio Estevam
2018-12-03 17:39         ` Otavio Salvador
2018-12-04  9:40           ` Wolfgang Denk
2018-12-04  9:37         ` Wolfgang Denk
2018-12-04 10:41           ` Fabio Estevam
2018-12-04 13:03             ` Wolfgang Denk
2018-12-04 13:18               ` Fabio Estevam
2018-12-04 13:35                 ` Wolfgang Denk
2018-12-04 14:15                   ` Fabio Estevam
2018-12-04 15:40                     ` [U-Boot] [PATCH] Enable expression support for CONFIG_BOARD_SIZE_LIMIT Wolfgang Denk
2018-12-04 15:42                       ` Otavio Salvador
2018-12-04 16:15                       ` Fabio Estevam
2018-12-05  9:52                         ` Wolfgang Denk [this message]
2018-12-06 13:04                           ` Fabio Estevam
2018-12-06 14:23                             ` Wolfgang Denk
2018-12-06 14:41                               ` Fabio Estevam
2018-12-06 14:44                                 ` Andy Pont
2018-12-06 14:58                                   ` Fabio Estevam
2018-12-06 15:01                                     ` Fabio Estevam
2018-12-06 14:50                                 ` Philipp Tomsich
2018-12-06 15:06                                   ` Fabio Estevam
2018-12-06 15:17                                 ` Fabio Estevam
2018-12-07 15:21                                   ` Wolfgang Denk
2018-12-07 15:37                                     ` Fabio Estevam
2018-12-07 19:28                                       ` Wolfgang Denk
2018-12-07 19:27                       ` [U-Boot] [PATCH v2] " Wolfgang Denk
2018-12-14 19:16                         ` [U-Boot] [U-Boot, " Tom Rini
2019-03-06 20:54                           ` Simon Goldschmidt
2019-03-08 17:17                             ` Tom Rini
2019-03-08 17:28                               ` Martin Husemann
2019-03-08 17:53                                 ` Philipp Tomsich
2019-03-08 18:16                                   ` Simon Goldschmidt
2019-03-08 19:55                                   ` Tom Rini
2019-03-15 10:13                                 ` Ismael Luceno Cortes
2018-12-17 14:13 ` [U-Boot] [PATCH v4] pico-imx7d: Increase the CONFIG_ENV_OFFSET size Fabio Estevam
2018-12-17 14:47   ` Stefano Babic
2018-12-17 14:50     ` Fabio Estevam

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181205095202.027A5242268@gemini.denx.de \
    --to=wd@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox