All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Diego Sueiro" <diego.sueiro@arm.com>
To: "denis@denix.org" <denis@denix.org>, Joshua Watt <jpewhacker@gmail.com>
Cc: "meta-arm@lists.yoctoproject.org"
	<meta-arm@lists.yoctoproject.org>, nd <nd@arm.com>
Subject: Re: [meta-arm] [PATCH 1/2] trusted-firmware-a: support multi-board platforms
Date: Thu, 14 May 2020 06:22:02 +0000	[thread overview]
Message-ID: <AM0PR08MB3987239EA87234650DFF48CE92BC0@AM0PR08MB3987.eurprd08.prod.outlook.com> (raw)
In-Reply-To: <20200514000436.GW11927@denix.org>

> -----Original Message-----
> From: meta-arm@lists.yoctoproject.org <meta-arm@lists.yoctoproject.org>
> On Behalf Of Denys Dmytriyenko via lists.yoctoproject.org
> Sent: 14 May 2020 01:05
> To: Joshua Watt <jpewhacker@gmail.com>
> Cc: meta-arm@lists.yoctoproject.org
> Subject: Re: [meta-arm] [PATCH 1/2] trusted-firmware-a: support multi-
> board platforms
> 
> On Wed, May 13, 2020 at 06:44:32PM -0500, Joshua Watt wrote:
> > On Wed, May 13, 2020, 6:30 PM Denys Dmytriyenko <denis@denix.org>
> wrote:
> >
> > > From: Denys Dmytriyenko <denys@ti.com>
> > >
> > > Some platforms can have multiple board configurations, passed as
> > > TARGET_BOARD=""
> > > that also becomes an extra directory level in the build output hierarchy.
> > >
> > > Signed-off-by: Denys Dmytriyenko <denys@ti.com>
> > > ---
> > >  .../recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc    | 12
> > > ++++++++++--
> > >  1 file changed, 10 insertions(+), 2 deletions(-)
> > >
> > > diff --git
> > > a/meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc
> > > b/meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc
> > > index 4b5da7a..b88b514 100644
> > > --- a/meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc
> > > +++ b/meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc
> > > @@ -12,6 +12,10 @@ COMPATIBLE_MACHINE ?= "invalid"
> > >  # Platform must be set for each machine  TFA_PLATFORM ?= "invalid"
> > >
> > > +# Some platforms can have multiple board configurations # Leave
> > > +empty for default behavior TFA_BOARD ?= ""
> > > +
> > >  # Build for debug (set TFA_DEBUG to 1 to activate)  TFA_DEBUG ?=
> > > "0"
> > >
> > > @@ -65,6 +69,10 @@ DEPENDS_append = " dtc-native openssl-native"
> > >  # Add platform parameter
> > >  EXTRA_OEMAKE += "BUILD_BASE=${B} PLAT=${TFA_PLATFORM}"
> > >
> > > +# Handle TFA_BOARD parameter
> > > +EXTRA_OEMAKE += "${@['',
> > > 'TARGET_BOARD=${TFA_BOARD}'][bool(d.getVar('TFA_BOARD'))]}"
> > > +BUILD_DIR = "${@['${TFA_PLATFORM}',
> > > '${TFA_PLATFORM}/${TFA_BOARD}'][bool(d.getVar('TFA_BOARD'))]}"
> > >
> >
> > I noticed you're doing the Boolean index trick. A little more pythonic
> > and IMHO easier to read would be:
> >
> >  "${TFA_PLATFORM}${@'/${TFA_BOARD}' if d.getVar('TFA_BOARD') else ''}"
> 
> Hmm, I saw OE-Core using the Boolean index trick in bitbake.conf and other
> places quite a lot - I was just following the tradition.
> 
> For me personally pure pythonic is too much of a brain twist - booleans,
> simple arrays and such are more natural for me to understand... :)
> 
> But if required, I can change - just let me know.
> 

I vote for keeping the consistency with the rest of the recipe.

> 
> > >  # Handle TFA_DEBUG parameter
> > >  EXTRA_OEMAKE += "${@bb.utils.contains('TFA_DEBUG', '1', '
> > > DEBUG=${TFA_DEBUG}', '', d)}"
> > >
> > > @@ -93,9 +101,9 @@ do_compile[cleandirs] = "${B}"
> > >
> > >  do_install() {
> > >      if ${@"true" if d.getVar('TFA_DEBUG') == '1' else "false"}; then
> > > -        BUILD_PLAT=${B}/${TFA_PLATFORM}/debug/
> > > +        BUILD_PLAT=${B}/${BUILD_DIR}/debug/
> > >      else
> > > -        BUILD_PLAT=${B}/${TFA_PLATFORM}/release/
> > > +        BUILD_PLAT=${B}/${BUILD_DIR}/release/
> > >      fi
> > >
> > >      install -d -m 755 ${D}/firmware
> > > --
> > > 2.7.4
> > >
> > >
> > >

  reply	other threads:[~2020-05-14  6:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-13 23:30 [PATCH 1/2] trusted-firmware-a: support multi-board platforms Denys Dmytriyenko
2020-05-13 23:30 ` [PATCH 2/2] trusted-firmware-a: add support for SPD (Secure Payload Dispatcher) services Denys Dmytriyenko
2020-05-13 23:44 ` [meta-arm] [PATCH 1/2] trusted-firmware-a: support multi-board platforms Joshua Watt
2020-05-14  0:04   ` Denys Dmytriyenko
2020-05-14  6:22     ` Diego Sueiro [this message]
2020-05-14  9:36     ` Ross Burton

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=AM0PR08MB3987239EA87234650DFF48CE92BC0@AM0PR08MB3987.eurprd08.prod.outlook.com \
    --to=diego.sueiro@arm.com \
    --cc=denis@denix.org \
    --cc=jpewhacker@gmail.com \
    --cc=meta-arm@lists.yoctoproject.org \
    --cc=nd@arm.com \
    /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.