All of lore.kernel.org
 help / color / mirror / Atom feed
* Conditional patches on kernel depending on board, how to maintain?
@ 2014-06-12 11:54 Daniel Hilst Selli
  2014-06-12 12:27 ` Patrick Doyle
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Daniel Hilst Selli @ 2014-06-12 11:54 UTC (permalink / raw)
  To: yocto

I have a SoM which will be used on several boards, this SoM has a base 
kernel for it, with its board-*.c file. In each board I may have 
different peripherals, so I have to patch the same board-*.c file 
depending on my target board, and that patches may be conflicting one 
each other. For example, I could have a RF on first SPI bus on one 
board, and on another board a SD card on same first SPI bus.

So basically I will have a different kernel(uImage) and rootfs (with 
kernel modules) for each board.

I think to create a layer for each target board, with the 
linux-SoM.bbappend including the patches for that board..., so I enable 
the layer depending on target board I'm creating, but is too much file 
editions, or have a build directory for each target board, enabling the 
right layer on each local.conf, but this means mantaining build 
directories, or at last local.conf, which doesn't seem a good idea for me...

Would be possible to do this relying only new layers and its configurations?

Thanks in advance
Cheers!


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

* Re: Conditional patches on kernel depending on board, how to maintain?
  2014-06-12 11:54 Conditional patches on kernel depending on board, how to maintain? Daniel Hilst Selli
@ 2014-06-12 12:27 ` Patrick Doyle
  2014-06-12 12:42   ` Daniel Hilst Selli
  2014-06-12 13:06 ` Nicolas Dechesne
  2014-06-12 15:51 ` Bruce Ashfield
  2 siblings, 1 reply; 5+ messages in thread
From: Patrick Doyle @ 2014-06-12 12:27 UTC (permalink / raw)
  To: Daniel Hilst Selli; +Cc: yocto

Can you compile the different device drivers as modules and load them
at runtime?
Can you compile the different device drivers statically and probe them
based on a devicetree file?

--wpd


On Thu, Jun 12, 2014 at 7:54 AM, Daniel Hilst Selli
<danielhilst@gmail.com> wrote:
> I have a SoM which will be used on several boards, this SoM has a base
> kernel for it, with its board-*.c file. In each board I may have different
> peripherals, so I have to patch the same board-*.c file depending on my
> target board, and that patches may be conflicting one each other. For
> example, I could have a RF on first SPI bus on one board, and on another
> board a SD card on same first SPI bus.
>
> So basically I will have a different kernel(uImage) and rootfs (with kernel
> modules) for each board.
>
> I think to create a layer for each target board, with the linux-SoM.bbappend
> including the patches for that board..., so I enable the layer depending on
> target board I'm creating, but is too much file editions, or have a build
> directory for each target board, enabling the right layer on each
> local.conf, but this means mantaining build directories, or at last
> local.conf, which doesn't seem a good idea for me...
>
> Would be possible to do this relying only new layers and its configurations?
>
> Thanks in advance
> Cheers!
> --
> _______________________________________________
> yocto mailing list
> yocto@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto


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

* Re: Conditional patches on kernel depending on board, how to maintain?
  2014-06-12 12:27 ` Patrick Doyle
@ 2014-06-12 12:42   ` Daniel Hilst Selli
  0 siblings, 0 replies; 5+ messages in thread
From: Daniel Hilst Selli @ 2014-06-12 12:42 UTC (permalink / raw)
  Cc: yocto

On 06/12/2014 09:27 AM, Patrick Doyle wrote:
> Can you compile the different device drivers as modules and load them
> at runtime?
> Can you compile the different device drivers statically and probe them
> based on a devicetree file?

Yes I do compile the device drivers as modules, but yet I have to 
register the *_board_info structs on board-*.c file, here is an example:

http://pastebin.com/GMSDQERB

Thanks in advance,
Cheers!

>
> --wpd
>
>
> On Thu, Jun 12, 2014 at 7:54 AM, Daniel Hilst Selli
> <danielhilst@gmail.com> wrote:
>> I have a SoM which will be used on several boards, this SoM has a base
>> kernel for it, with its board-*.c file. In each board I may have different
>> peripherals, so I have to patch the same board-*.c file depending on my
>> target board, and that patches may be conflicting one each other. For
>> example, I could have a RF on first SPI bus on one board, and on another
>> board a SD card on same first SPI bus.
>>
>> So basically I will have a different kernel(uImage) and rootfs (with kernel
>> modules) for each board.
>>
>> I think to create a layer for each target board, with the linux-SoM.bbappend
>> including the patches for that board..., so I enable the layer depending on
>> target board I'm creating, but is too much file editions, or have a build
>> directory for each target board, enabling the right layer on each
>> local.conf, but this means mantaining build directories, or at last
>> local.conf, which doesn't seem a good idea for me...
>>
>> Would be possible to do this relying only new layers and its configurations?
>>
>> Thanks in advance
>> Cheers!
>> --
>> _______________________________________________
>> yocto mailing list
>> yocto@yoctoproject.org
>> https://lists.yoctoproject.org/listinfo/yocto



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

* Re: Conditional patches on kernel depending on board, how to maintain?
  2014-06-12 11:54 Conditional patches on kernel depending on board, how to maintain? Daniel Hilst Selli
  2014-06-12 12:27 ` Patrick Doyle
@ 2014-06-12 13:06 ` Nicolas Dechesne
  2014-06-12 15:51 ` Bruce Ashfield
  2 siblings, 0 replies; 5+ messages in thread
From: Nicolas Dechesne @ 2014-06-12 13:06 UTC (permalink / raw)
  To: Daniel Hilst Selli; +Cc: Yocto list discussion

On Thu, Jun 12, 2014 at 1:54 PM, Daniel Hilst Selli
<danielhilst@gmail.com> wrote:
> I have a SoM which will be used on several boards, this SoM has a base
> kernel for it, with its board-*.c file. In each board I may have different
> peripherals, so I have to patch the same board-*.c file depending on my
> target board, and that patches may be conflicting one each other. For
> example, I could have a RF on first SPI bus on one board, and on another
> board a SD card on same first SPI bus.
>
> So basically I will have a different kernel(uImage) and rootfs (with kernel
> modules) for each board.
>
> I think to create a layer for each target board, with the linux-SoM.bbappend
> including the patches for that board..., so I enable the layer depending on
> target board I'm creating, but is too much file editions, or have a build
> directory for each target board, enabling the right layer on each
> local.conf, but this means mantaining build directories, or at last
> local.conf, which doesn't seem a good idea for me...
>
> Would be possible to do this relying only new layers and its configurations?
>

you can do:

SRC_URI_append_som1 = " file://som1.patch"

assuming som1 is a valid machine name (e.g. you have conf/machines/som1.conf)

you can do all builds with 1 layer, and 1 recipe for the kernel, with
many such lines.


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

* Re: Conditional patches on kernel depending on board, how to maintain?
  2014-06-12 11:54 Conditional patches on kernel depending on board, how to maintain? Daniel Hilst Selli
  2014-06-12 12:27 ` Patrick Doyle
  2014-06-12 13:06 ` Nicolas Dechesne
@ 2014-06-12 15:51 ` Bruce Ashfield
  2 siblings, 0 replies; 5+ messages in thread
From: Bruce Ashfield @ 2014-06-12 15:51 UTC (permalink / raw)
  To: Daniel Hilst Selli, yocto

On 14-06-12 07:54 AM, Daniel Hilst Selli wrote:
> I have a SoM which will be used on several boards, this SoM has a base
> kernel for it, with its board-*.c file. In each board I may have
> different peripherals, so I have to patch the same board-*.c file
> depending on my target board, and that patches may be conflicting one
> each other. For example, I could have a RF on first SPI bus on one
> board, and on another board a SD card on same first SPI bus.
>
> So basically I will have a different kernel(uImage) and rootfs (with
> kernel modules) for each board.
>
> I think to create a layer for each target board, with the
> linux-SoM.bbappend including the patches for that board..., so I enable
> the layer depending on target board I'm creating, but is too much file
> editions, or have a build directory for each target board, enabling the
> right layer on each local.conf, but this means mantaining build
> directories, or at last local.conf, which doesn't seem a good idea for
> me...
>
> Would be possible to do this relying only new layers and its
> configurations?

As was mentioned in the other replies, you can always have a single
bbappend with board specific SRC_URI updates to add the patches you
need onto the base board support.

It's unfortunate that the patches conflict, since stacking hem in
board specific SRC_URIs can lead to patch failures in some configs
and not others .. if you change the baseline.

Typically in this situation, I either #ifdef the patches and use
a different configuration to conditionally build the consistent set
of changes, or maintain the changes in a git repository with board
specific patches on each branch. Again, that git approach avoids
patch failures during build.

Cheers,

Bruce

>
> Thanks in advance
> Cheers!



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

end of thread, other threads:[~2014-06-12 15:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-12 11:54 Conditional patches on kernel depending on board, how to maintain? Daniel Hilst Selli
2014-06-12 12:27 ` Patrick Doyle
2014-06-12 12:42   ` Daniel Hilst Selli
2014-06-12 13:06 ` Nicolas Dechesne
2014-06-12 15:51 ` Bruce Ashfield

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.