All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH] u-boot: remove UBOOT_MACHINE and COMPATIBLE_MACHINES
@ 2011-05-17 23:00 Darren Hart
  2011-05-17 23:15 ` Richard Purdie
  0 siblings, 1 reply; 4+ messages in thread
From: Darren Hart @ 2011-05-17 23:00 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

oe-core does not define any machines, so it does not make sense to
add machine specific information in the oe-core u-boot recipe and
infrastructure.

Since every machine wishing to use the u-boot recipe would need to add itself to
COMPATIBLE_MACHINES, typically via a bbappend recipe, the mechanism loses any
utility it may have had and unecessarily complicates using the u-boot recipe. By
removing it, we simplify the task of adding support for new machines.

With these two variables removed from the base recipe, UBOOT_MACHINE must now be
specified in each machine config that requires u-boot. This is already the case
for UBOOT_ENTRYPOINT and UBOOT_LOADADDRESS, so the change is minimal. For
example, a beagleboard machine config currently contains:

UBOOT_ENTRYPOINT = "0x80008000"
UBOOT_LOADADDRESS = "0x80008000"

With this change, it must now contain:

UBOOT_MACHINE = "omap3_beagle_config"
UBOOT_ENTRYPOINT = "0x80008000"
UBOOT_LOADADDRESS = "0x80008000"

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
---
 meta/recipes-bsp/uboot/u-boot_git.bb |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/meta/recipes-bsp/uboot/u-boot_git.bb b/meta/recipes-bsp/uboot/u-boot_git.bb
index c5583ff..1fa0da2 100644
--- a/meta/recipes-bsp/uboot/u-boot_git.bb
+++ b/meta/recipes-bsp/uboot/u-boot_git.bb
@@ -1,5 +1,9 @@
 require u-boot.inc
 
+# To build u-boot for your machine, provide the following lines in your machine
+# config, replacing "omap3_beagle" with the appropriate value for your machine.
+# UBOOT_MACHINE = "omap3_beagle_config"
+
 LICENSE = "GPLv2+"
 LIC_FILES_CHKSUM = "file://COPYING;md5=1707d6db1d42237583f50183a5651ecb \
                     file://README;beginline=1;endline=22;md5=3a00ef51d3fc96e9d6c1bc4708ccd3b5"
@@ -12,11 +16,6 @@ PR="r3"
 
 SRC_URI = "git://git.denx.de/u-boot.git;branch=master;protocol=git"
 
-UBOOT_MACHINE_beagleboard = "omap3_beagle_config"
-UBOOT_MACHINE_overo = "omap3_overo_config"
-
 S = "${WORKDIR}/git"
 
 PACKAGE_ARCH = "${MACHINE_ARCH}"
-
-COMPATIBLE_MACHINE = "(beagleboard|overo)"
-- 
1.7.1
-- 
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [RFC PATCH] u-boot: remove UBOOT_MACHINE and COMPATIBLE_MACHINES
  2011-05-17 23:00 [RFC PATCH] u-boot: remove UBOOT_MACHINE and COMPATIBLE_MACHINES Darren Hart
@ 2011-05-17 23:15 ` Richard Purdie
  2011-05-17 23:37   ` Darren Hart
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Purdie @ 2011-05-17 23:15 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

On Tue, 2011-05-17 at 16:00 -0700, Darren Hart wrote:
> oe-core does not define any machines, so it does not make sense to
> add machine specific information in the oe-core u-boot recipe and
> infrastructure.
> 
> Since every machine wishing to use the u-boot recipe would need to add itself to
> COMPATIBLE_MACHINES, typically via a bbappend recipe, the mechanism loses any
> utility it may have had and unecessarily complicates using the u-boot recipe. By
> removing it, we simplify the task of adding support for new machines.

NAK.

This break usability of things like "bitbake world" since all of a
sudden it will try and build u-boot in cases where it makes no sense
(qemu* machines for example).

I know it sounds strange but we do want this recipe enabled on a case by
case basis (and we have the beagleboard as a reference platform using it
which is handy). This means the default of no supported machine is
correct even if it looks odd.

Having the recipe deselect itself (raise a skip parsing event) if
UBOOT_MACHINE isn't set instead of using COMPATIBLE_MACHINE would be
acceptable though.

Cheers,

Richard




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFC PATCH] u-boot: remove UBOOT_MACHINE and COMPATIBLE_MACHINES
  2011-05-17 23:15 ` Richard Purdie
@ 2011-05-17 23:37   ` Darren Hart
  2011-05-18 11:46     ` Richard Purdie
  0 siblings, 1 reply; 4+ messages in thread
From: Darren Hart @ 2011-05-17 23:37 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer



On 05/17/2011 04:15 PM, Richard Purdie wrote:
> On Tue, 2011-05-17 at 16:00 -0700, Darren Hart wrote:
>> oe-core does not define any machines, so it does not make sense to
>> add machine specific information in the oe-core u-boot recipe and
>> infrastructure.
>>
>> Since every machine wishing to use the u-boot recipe would need to add itself to
>> COMPATIBLE_MACHINES, typically via a bbappend recipe, the mechanism loses any
>> utility it may have had and unecessarily complicates using the u-boot recipe. By
>> removing it, we simplify the task of adding support for new machines.
> 
> NAK.
> 
> This break usability of things like "bitbake world" since all of a
> sudden it will try and build u-boot in cases where it makes no sense
> (qemu* machines for example).

OK, I thought there might be something like that surrounding
COMPATIBLE_MACHINE, thus the RFC.

> 
> I know it sounds strange but we do want this recipe enabled on a case by
> case basis (and we have the beagleboard as a reference platform using it
> which is handy). This means the default of no supported machine is
> correct even if it looks odd.
> 
> Having the recipe deselect itself (raise a skip parsing event) if
> UBOOT_MACHINE isn't set instead of using COMPATIBLE_MACHINE would be
> acceptable though.

That sounds promising. I'd like to avoid having to create a
u-boot_git.bbappend everytime you want to use u-boot. Is there an
example you can think of that does this? greping for "deselect" and
"skip pars" didn't yield any results.

Thanks,

-- 
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFC PATCH] u-boot: remove UBOOT_MACHINE and COMPATIBLE_MACHINES
  2011-05-17 23:37   ` Darren Hart
@ 2011-05-18 11:46     ` Richard Purdie
  0 siblings, 0 replies; 4+ messages in thread
From: Richard Purdie @ 2011-05-18 11:46 UTC (permalink / raw)
  To: Darren Hart; +Cc: Patches and discussions about the oe-core layer

On Tue, 2011-05-17 at 16:37 -0700, Darren Hart wrote:
> 
> On 05/17/2011 04:15 PM, Richard Purdie wrote:
> > On Tue, 2011-05-17 at 16:00 -0700, Darren Hart wrote:
> >> oe-core does not define any machines, so it does not make sense to
> >> add machine specific information in the oe-core u-boot recipe and
> >> infrastructure.
> >>
> >> Since every machine wishing to use the u-boot recipe would need to add itself to
> >> COMPATIBLE_MACHINES, typically via a bbappend recipe, the mechanism loses any
> >> utility it may have had and unecessarily complicates using the u-boot recipe. By
> >> removing it, we simplify the task of adding support for new machines.
> > 
> > NAK.
> > 
> > This break usability of things like "bitbake world" since all of a
> > sudden it will try and build u-boot in cases where it makes no sense
> > (qemu* machines for example).
> 
> OK, I thought there might be something like that surrounding
> COMPATIBLE_MACHINE, thus the RFC.
> 
> > 
> > I know it sounds strange but we do want this recipe enabled on a case by
> > case basis (and we have the beagleboard as a reference platform using it
> > which is handy). This means the default of no supported machine is
> > correct even if it looks odd.
> > 
> > Having the recipe deselect itself (raise a skip parsing event) if
> > UBOOT_MACHINE isn't set instead of using COMPATIBLE_MACHINE would be
> > acceptable though.
> 
> That sounds promising. I'd like to avoid having to create a
> u-boot_git.bbappend everytime you want to use u-boot. Is there an
> example you can think of that does this? greping for "deselect" and
> "skip pars" didn't yield any results.

grepping base.bbclass for COMPATIBLE_MACHINE might be more productive :)

The key piece is:

need_machine = bb.data.getVar('COMPATIBLE_MACHINE', d, 1)
if need_machine:
    import re
        this_machine = bb.data.getVar('MACHINE', d, 1)
        if this_machine and not re.match(need_machine, this_machine):
                raise bb.parse.SkipPackage("incompatible with machine %s" % this_machine)

which I think shows what I'm talking about clearly. And yes, ideally
this would have been called SkipRecipe but its from the days when we
were much more confused about terminology ;-).

Cheers,

Richard




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-05-18 11:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-17 23:00 [RFC PATCH] u-boot: remove UBOOT_MACHINE and COMPATIBLE_MACHINES Darren Hart
2011-05-17 23:15 ` Richard Purdie
2011-05-17 23:37   ` Darren Hart
2011-05-18 11:46     ` Richard Purdie

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.