All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Pali Rohár" <pali@kernel.org>
To: Stefan Roese <sr@denx.de>
Cc: "Chris Packham" <chris.packham@alliedtelesis.co.nz>,
	"Phil Sutter" <phil@nwl.cc>,
	"Dennis Gilmore" <dgilmore@redhat.com>,
	"Marek Behún" <marek.behun@nic.cz>,
	u-boot@lists.denx.de
Subject: Re: [PATCH] arm: mvebu: Replace hardcoded values 0x0030/0x4030 by proper calculation
Date: Thu, 13 Jan 2022 11:49:30 +0100	[thread overview]
Message-ID: <20220113104930.zihznhy4q4ctv3vw@pali> (raw)
In-Reply-To: <56bf9356-f99a-a77c-cc02-6687b4abdb74@denx.de>

On Thursday 13 January 2022 07:51:41 Stefan Roese wrote:
> On 1/12/22 18:32, Pali Rohár wrote:
> > These hardcoded values were calculated from CONFIG_SPL_TEXT_BASE macro. Now
> > this macro is configurable via Kconfig, so calculate values 0x0030/0x4030
> > at compile time via CONFIG_SPL_TEXT_BASE option. Values 0x0030/0x4030
> > represents offset of CONFIG_SPL_TEXT_BASE from address 0x40000000.
> > 
> > Signed-off-by: Pali Rohár <pali@kernel.org>
> > ---
> >   include/configs/clearfog.h       | 2 +-
> >   include/configs/db-88f6720.h     | 2 +-
> >   include/configs/db-88f6820-amc.h | 2 +-
> >   include/configs/db-88f6820-gp.h  | 2 +-
> >   include/configs/db-mv784mp-gp.h  | 2 +-
> >   include/configs/ds414.h          | 2 +-
> >   include/configs/helios4.h        | 2 +-
> >   include/configs/maxbcm.h         | 2 +-
> >   include/configs/theadorable.h    | 2 +-
> >   include/configs/turris_omnia.h   | 2 +-
> >   include/configs/x530.h           | 2 +-
> >   11 files changed, 11 insertions(+), 11 deletions(-)
> > 
> > diff --git a/include/configs/clearfog.h b/include/configs/clearfog.h
> > index a30bca5147a8..c9af5a40cec0 100644
> > --- a/include/configs/clearfog.h
> > +++ b/include/configs/clearfog.h
> > @@ -53,7 +53,7 @@
> >   /* Defines for SPL */
> >   #define CONFIG_SPL_SIZE			(140 << 10)
> > -#define CONFIG_SPL_MAX_SIZE		(CONFIG_SPL_SIZE - 0x0030)
> > +#define CONFIG_SPL_MAX_SIZE		(CONFIG_SPL_SIZE - (CONFIG_SPL_TEXT_BASE - 0x40000000))
> >   #define CONFIG_SPL_BSS_START_ADDR	(0x40000000 + CONFIG_SPL_SIZE)
> >   #define CONFIG_SPL_BSS_MAX_SIZE		(16 << 10)
> > diff --git a/include/configs/db-88f6720.h b/include/configs/db-88f6720.h
> > index cf9e44d17c32..16c83a88dace 100644
> > --- a/include/configs/db-88f6720.h
> > +++ b/include/configs/db-88f6720.h
> > @@ -34,7 +34,7 @@
> >   /* SPL */
> >   /* Defines for SPL */
> > -#define CONFIG_SPL_MAX_SIZE		((128 << 10) - 0x0030)
> > +#define CONFIG_SPL_MAX_SIZE		((128 << 10) - (CONFIG_SPL_TEXT_BASE - 0x40000000))
> >   #define CONFIG_SPL_BSS_START_ADDR	(0x40000000 + (128 << 10))
> 
> Thanks for working on this. Looking at this diff I'm wondering if it
> would be another "improvement" to replace all 0x40000000 occurrences by
> some other macro? Perhaps in a follow-up patch.

Yes, adding a new macro for 0x40000000 address, perhaps in mv-common.h
in a follow-up patch is a good idea. And now it should be possible to
move more CONFIG_SPL_* macros into mv-common.h file.

> But anyways, for this patch:
> 
> Reviewed-by: Stefan Roese <sr@denx.de>
> 
> Thanks,
> Stefan
> 
> >   #define CONFIG_SPL_BSS_MAX_SIZE		(16 << 10)
> > diff --git a/include/configs/db-88f6820-amc.h b/include/configs/db-88f6820-amc.h
> > index 1f70c609d234..6538e66052aa 100644
> > --- a/include/configs/db-88f6820-amc.h
> > +++ b/include/configs/db-88f6820-amc.h
> > @@ -41,7 +41,7 @@
> >   /* Defines for SPL */
> >   #define CONFIG_SPL_SIZE			(140 << 10)
> > -#define CONFIG_SPL_MAX_SIZE		(CONFIG_SPL_SIZE - 0x0030)
> > +#define CONFIG_SPL_MAX_SIZE		(CONFIG_SPL_SIZE - (CONFIG_SPL_TEXT_BASE - 0x40000000))
> >   #define CONFIG_SPL_BSS_START_ADDR	(0x40000000 + CONFIG_SPL_SIZE)
> >   #define CONFIG_SPL_BSS_MAX_SIZE		(16 << 10)
> > diff --git a/include/configs/db-88f6820-gp.h b/include/configs/db-88f6820-gp.h
> > index 41dadfebb948..5f2611995d35 100644
> > --- a/include/configs/db-88f6820-gp.h
> > +++ b/include/configs/db-88f6820-gp.h
> > @@ -50,7 +50,7 @@
> >   /* Defines for SPL */
> >   #define CONFIG_SPL_SIZE			(140 << 10)
> > -#define CONFIG_SPL_MAX_SIZE		(CONFIG_SPL_SIZE - 0x0030)
> > +#define CONFIG_SPL_MAX_SIZE		(CONFIG_SPL_SIZE - (CONFIG_SPL_TEXT_BASE - 0x40000000))
> >   #define CONFIG_SPL_BSS_START_ADDR	(0x40000000 + CONFIG_SPL_SIZE)
> >   #define CONFIG_SPL_BSS_MAX_SIZE		(16 << 10)
> > diff --git a/include/configs/db-mv784mp-gp.h b/include/configs/db-mv784mp-gp.h
> > index dbbc33ebf9c3..449a56753b17 100644
> > --- a/include/configs/db-mv784mp-gp.h
> > +++ b/include/configs/db-mv784mp-gp.h
> > @@ -59,7 +59,7 @@
> >   /* SPL */
> >   /* Defines for SPL */
> > -#define CONFIG_SPL_MAX_SIZE		((128 << 10) - 0x4030)
> > +#define CONFIG_SPL_MAX_SIZE		((128 << 10) - (CONFIG_SPL_TEXT_BASE - 0x40000000))
> >   #define CONFIG_SPL_BSS_START_ADDR	(0x40000000 + (128 << 10))
> >   #define CONFIG_SPL_BSS_MAX_SIZE		(16 << 10)
> > diff --git a/include/configs/ds414.h b/include/configs/ds414.h
> > index 7fba2b4cc427..dbccd46bbdb1 100644
> > --- a/include/configs/ds414.h
> > +++ b/include/configs/ds414.h
> > @@ -45,7 +45,7 @@
> >   /* SPL */
> >   /* Defines for SPL */
> > -#define CONFIG_SPL_MAX_SIZE		((128 << 10) - 0x4030)
> > +#define CONFIG_SPL_MAX_SIZE		((128 << 10) - (CONFIG_SPL_TEXT_BASE - 0x40000000))
> >   #define CONFIG_SPL_BSS_START_ADDR	(0x40000000 + (128 << 10))
> >   #define CONFIG_SPL_BSS_MAX_SIZE		(16 << 10)
> > diff --git a/include/configs/helios4.h b/include/configs/helios4.h
> > index 56d35d6fdbc6..de1ebbf37516 100644
> > --- a/include/configs/helios4.h
> > +++ b/include/configs/helios4.h
> > @@ -53,7 +53,7 @@
> >   /* Defines for SPL */
> >   #define CONFIG_SPL_SIZE			(140 << 10)
> > -#define CONFIG_SPL_MAX_SIZE		(CONFIG_SPL_SIZE - 0x0030)
> > +#define CONFIG_SPL_MAX_SIZE		(CONFIG_SPL_SIZE - (CONFIG_SPL_TEXT_BASE - 0x40000000))
> >   #define CONFIG_SPL_BSS_START_ADDR	(0x40000000 + CONFIG_SPL_SIZE)
> >   #define CONFIG_SPL_BSS_MAX_SIZE		(16 << 10)
> > diff --git a/include/configs/maxbcm.h b/include/configs/maxbcm.h
> > index 53ba64909e1f..073c5a57b2c9 100644
> > --- a/include/configs/maxbcm.h
> > +++ b/include/configs/maxbcm.h
> > @@ -48,7 +48,7 @@
> >   /* SPL */
> >   /* Defines for SPL */
> > -#define CONFIG_SPL_MAX_SIZE		((128 << 10) - 0x4030)
> > +#define CONFIG_SPL_MAX_SIZE		((128 << 10) - (CONFIG_SPL_TEXT_BASE - 0x40000000))
> >   #define CONFIG_SPL_BSS_START_ADDR	(0x40000000 + (128 << 10))
> >   #define CONFIG_SPL_BSS_MAX_SIZE		(16 << 10)
> > diff --git a/include/configs/theadorable.h b/include/configs/theadorable.h
> > index b43c03d3e8a9..3c942cc6fa01 100644
> > --- a/include/configs/theadorable.h
> > +++ b/include/configs/theadorable.h
> > @@ -77,7 +77,7 @@
> >   /* SPL */
> >   /* Defines for SPL */
> > -#define CONFIG_SPL_MAX_SIZE		((128 << 10) - 0x4030)
> > +#define CONFIG_SPL_MAX_SIZE		((128 << 10) - (CONFIG_SPL_TEXT_BASE - 0x40000000))
> >   #define CONFIG_SPL_BSS_START_ADDR	(0x40000000 + (128 << 10))
> >   #define CONFIG_SPL_BSS_MAX_SIZE		(16 << 10)
> > diff --git a/include/configs/turris_omnia.h b/include/configs/turris_omnia.h
> > index 9436a623d6fe..b35299b2fbb3 100644
> > --- a/include/configs/turris_omnia.h
> > +++ b/include/configs/turris_omnia.h
> > @@ -28,7 +28,7 @@
> >   /* Defines for SPL */
> >   #define CONFIG_SPL_SIZE			(140 << 10)
> > -#define CONFIG_SPL_MAX_SIZE		(CONFIG_SPL_SIZE - 0x0030)
> > +#define CONFIG_SPL_MAX_SIZE		(CONFIG_SPL_SIZE - (CONFIG_SPL_TEXT_BASE - 0x40000000))
> >   #define CONFIG_SPL_BSS_START_ADDR	(0x40000000 + CONFIG_SPL_SIZE)
> >   #define CONFIG_SPL_BSS_MAX_SIZE		(16 << 10)
> > diff --git a/include/configs/x530.h b/include/configs/x530.h
> > index e78e249e41ae..67ff01db9041 100644
> > --- a/include/configs/x530.h
> > +++ b/include/configs/x530.h
> > @@ -68,7 +68,7 @@
> >   /* Defines for SPL */
> >   #define CONFIG_SPL_SIZE			(140 << 10)
> > -#define CONFIG_SPL_MAX_SIZE		(CONFIG_SPL_SIZE - 0x0030)
> > +#define CONFIG_SPL_MAX_SIZE		(CONFIG_SPL_SIZE - (CONFIG_SPL_TEXT_BASE - 0x40000000))
> >   #define CONFIG_SPL_BSS_START_ADDR	(0x40000000 + CONFIG_SPL_SIZE)
> >   #define CONFIG_SPL_BSS_MAX_SIZE		(16 << 10)
> > 
> 
> Viele Grüße,
> Stefan Roese
> 
> -- 
> DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr@denx.de

  reply	other threads:[~2022-01-13 10:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-12 17:32 [PATCH] arm: mvebu: Replace hardcoded values 0x0030/0x4030 by proper calculation Pali Rohár
2022-01-12 22:27 ` Marek Behún
2022-01-12 22:31   ` Pali Rohár
2022-01-13  6:51 ` Stefan Roese
2022-01-13 10:49   ` Pali Rohár [this message]
2022-01-14 15:41 ` Stefan Roese

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=20220113104930.zihznhy4q4ctv3vw@pali \
    --to=pali@kernel.org \
    --cc=chris.packham@alliedtelesis.co.nz \
    --cc=dgilmore@redhat.com \
    --cc=marek.behun@nic.cz \
    --cc=phil@nwl.cc \
    --cc=sr@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.