public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] what is the *recommended* split between defconfig file and header file?
@ 2016-07-19  8:15 Robert P. J. Day
  2016-07-19 19:24 ` Tom Rini
  0 siblings, 1 reply; 7+ messages in thread
From: Robert P. J. Day @ 2016-07-19  8:15 UTC (permalink / raw)
  To: u-boot


  kind of a style question but what is the preferred way to define a
board in the sense of what belongs in the defconfig file and what
belongs in the header file?

  example: i'm now messing with a MPC8315ERDB, and here's
configs/MPC8315ERDB_defconfig in its entirety:

CONFIG_PPC=y
CONFIG_MPC83xx=y
CONFIG_TARGET_MPC8315ERDB=y
CONFIG_OF_BOARD_SETUP=y
CONFIG_OF_STDOUT_VIA_ALIAS=y
CONFIG_BOOTDELAY=6
CONFIG_HUSH_PARSER=y
CONFIG_CMD_I2C=y
CONFIG_CMD_USB=y
# CONFIG_CMD_SETEXPR is not set
CONFIG_CMD_MII=y
CONFIG_CMD_PING=y
CONFIG_CMD_EXT2=y
CONFIG_SYS_NS16550=y
CONFIG_OF_LIBFDT=y

  based on my current understanding, the absolute minimum i would need
in this defconfig file is just the first three lines:

CONFIG_PPC=y
CONFIG_MPC83xx=y
CONFIG_TARGET_MPC8315ERDB=y

which is sufficient to get me to the corresponding header file
include/configs/MPC8315ERDB.h, at which point we're good.

  but is there a recommended style for what belongs in the defconfig
file, and what belongs in the header file? or is that all just
personal preference?

  i do appreciate that if there is a family of closely-related target
boards, the header file can further include a "common" header file to
avoid duplication but, beyond that, any style rules?

rday

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================

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

* [U-Boot] what is the *recommended* split between defconfig file and header file?
  2016-07-19  8:15 [U-Boot] what is the *recommended* split between defconfig file and header file? Robert P. J. Day
@ 2016-07-19 19:24 ` Tom Rini
  2016-07-20  8:56   ` Robert P. J. Day
  2016-07-21 11:24   ` Robert P. J. Day
  0 siblings, 2 replies; 7+ messages in thread
From: Tom Rini @ 2016-07-19 19:24 UTC (permalink / raw)
  To: u-boot

On Tue, Jul 19, 2016 at 04:15:47AM -0400, Robert P. J. Day wrote:

> 
>   kind of a style question but what is the preferred way to define a
> board in the sense of what belongs in the defconfig file and what
> belongs in the header file?

The header files will eventually go away.  Most of the contents are
things that could be, but haven't yet been, converted.  A few things
like default environment are going to be harder to figure out.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160719/7b286aa0/attachment.sig>

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

* [U-Boot] what is the *recommended* split between defconfig file and header file?
  2016-07-19 19:24 ` Tom Rini
@ 2016-07-20  8:56   ` Robert P. J. Day
  2016-07-20 10:21     ` Andreas Färber
  2016-07-21 11:24   ` Robert P. J. Day
  1 sibling, 1 reply; 7+ messages in thread
From: Robert P. J. Day @ 2016-07-20  8:56 UTC (permalink / raw)
  To: u-boot

On Tue, 19 Jul 2016, Tom Rini wrote:

> On Tue, Jul 19, 2016 at 04:15:47AM -0400, Robert P. J. Day wrote:
>
> >
> >   kind of a style question but what is the preferred way to define a
> > board in the sense of what belongs in the defconfig file and what
> > belongs in the header file?
>
> The header files will eventually go away.  Most of the contents are
> things that could be, but haven't yet been, converted.  A few things
> like default environment are going to be harder to figure out.

  and what about the advantage of header files that allow the
inclusion of other header files to reduce duplication? will config
files be extended to allow the same thing? (they don't do that now, do
they?)

rday

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================

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

* [U-Boot] what is the *recommended* split between defconfig file and header file?
  2016-07-20  8:56   ` Robert P. J. Day
@ 2016-07-20 10:21     ` Andreas Färber
  2016-07-20 12:20       ` Tom Rini
  0 siblings, 1 reply; 7+ messages in thread
From: Andreas Färber @ 2016-07-20 10:21 UTC (permalink / raw)
  To: u-boot

Am 20.07.2016 um 10:56 schrieb Robert P. J. Day:
> On Tue, 19 Jul 2016, Tom Rini wrote:
> 
>> On Tue, Jul 19, 2016 at 04:15:47AM -0400, Robert P. J. Day wrote:
>>
>>>
>>>   kind of a style question but what is the preferred way to define a
>>> board in the sense of what belongs in the defconfig file and what
>>> belongs in the header file?
>>
>> The header files will eventually go away.  Most of the contents are
>> things that could be, but haven't yet been, converted.  A few things
>> like default environment are going to be harder to figure out.
> 
>   and what about the advantage of header files that allow the
> inclusion of other header files to reduce duplication? will config
> files be extended to allow the same thing? (they don't do that now, do
> they?)

Use Kconfig files for setting defaults or adding selects.

Andreas

-- 
SUSE Linux GmbH, Maxfeldstr. 5, 90409 N?rnberg, Germany
GF: Felix Imend?rffer, Jane Smithard, Graham Norton
HRB 21284 (AG N?rnberg)

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

* [U-Boot] what is the *recommended* split between defconfig file and header file?
  2016-07-20 10:21     ` Andreas Färber
@ 2016-07-20 12:20       ` Tom Rini
  0 siblings, 0 replies; 7+ messages in thread
From: Tom Rini @ 2016-07-20 12:20 UTC (permalink / raw)
  To: u-boot

On Wed, Jul 20, 2016 at 12:21:16PM +0200, Andreas F?rber wrote:
> Am 20.07.2016 um 10:56 schrieb Robert P. J. Day:
> > On Tue, 19 Jul 2016, Tom Rini wrote:
> > 
> >> On Tue, Jul 19, 2016 at 04:15:47AM -0400, Robert P. J. Day wrote:
> >>
> >>>
> >>>   kind of a style question but what is the preferred way to define a
> >>> board in the sense of what belongs in the defconfig file and what
> >>> belongs in the header file?
> >>
> >> The header files will eventually go away.  Most of the contents are
> >> things that could be, but haven't yet been, converted.  A few things
> >> like default environment are going to be harder to figure out.
> > 
> >   and what about the advantage of header files that allow the
> > inclusion of other header files to reduce duplication? will config
> > files be extended to allow the same thing? (they don't do that now, do
> > they?)
> 
> Use Kconfig files for setting defaults or adding selects.

Yes.  I am in favour of making heavy use of "default y if ..."
constructs and when possible some meta-options such as DISTRO_DEFAULTS

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160720/f723a6e1/attachment.sig>

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

* [U-Boot] what is the *recommended* split between defconfig file and header file?
  2016-07-19 19:24 ` Tom Rini
  2016-07-20  8:56   ` Robert P. J. Day
@ 2016-07-21 11:24   ` Robert P. J. Day
  2016-07-21 14:44     ` Tom Rini
  1 sibling, 1 reply; 7+ messages in thread
From: Robert P. J. Day @ 2016-07-21 11:24 UTC (permalink / raw)
  To: u-boot

On Tue, 19 Jul 2016, Tom Rini wrote:

> On Tue, Jul 19, 2016 at 04:15:47AM -0400, Robert P. J. Day wrote:
> >
> > kind of a style question but what is the preferred way to define a
> > board in the sense of what belongs in the defconfig file and what
> > belongs in the header file?
>
> The header files will eventually go away.  Most of the contents are
> things that could be, but haven't yet been, converted.  A few things
> like default environment are going to be harder to figure out.

  perhaps i haven't thought this through sufficiently, but it seems
like moving all target configuration to the *_defconfig files and
Kbuild system is going to require a fair bit of variable renaming.

  as i recall from the linux kernel coding style, any variables that
begin with "CONFIG_" are meant to be defined in a Kconfig file
somewhere, so if variables are moved from header files to a Kconfig
file to be part of Kbuild, would that not require renaming them if
they don't begin with "CONFIG_"? unless there's no plan to try to keep
that standard.

rday

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================

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

* [U-Boot] what is the *recommended* split between defconfig file and header file?
  2016-07-21 11:24   ` Robert P. J. Day
@ 2016-07-21 14:44     ` Tom Rini
  0 siblings, 0 replies; 7+ messages in thread
From: Tom Rini @ 2016-07-21 14:44 UTC (permalink / raw)
  To: u-boot

On Thu, Jul 21, 2016 at 07:24:10AM -0400, Robert P. J. Day wrote:
> On Tue, 19 Jul 2016, Tom Rini wrote:
> 
> > On Tue, Jul 19, 2016 at 04:15:47AM -0400, Robert P. J. Day wrote:
> > >
> > > kind of a style question but what is the preferred way to define a
> > > board in the sense of what belongs in the defconfig file and what
> > > belongs in the header file?
> >
> > The header files will eventually go away.  Most of the contents are
> > things that could be, but haven't yet been, converted.  A few things
> > like default environment are going to be harder to figure out.
> 
>   perhaps i haven't thought this through sufficiently, but it seems
> like moving all target configuration to the *_defconfig files and
> Kbuild system is going to require a fair bit of variable renaming.
> 
>   as i recall from the linux kernel coding style, any variables that
> begin with "CONFIG_" are meant to be defined in a Kconfig file
> somewhere, so if variables are moved from header files to a Kconfig
> file to be part of Kbuild, would that not require renaming them if
> they don't begin with "CONFIG_"? unless there's no plan to try to keep
> that standard.

No, you're right, there are a number of things we have today that are in
CONFIG namespace but aren't really configurable options, so we'll be
renaming those as we hit them.  But at the end of the day it will result
in a more easily customizable system too.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160721/9ca1254a/attachment.sig>

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

end of thread, other threads:[~2016-07-21 14:44 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-19  8:15 [U-Boot] what is the *recommended* split between defconfig file and header file? Robert P. J. Day
2016-07-19 19:24 ` Tom Rini
2016-07-20  8:56   ` Robert P. J. Day
2016-07-20 10:21     ` Andreas Färber
2016-07-20 12:20       ` Tom Rini
2016-07-21 11:24   ` Robert P. J. Day
2016-07-21 14:44     ` Tom Rini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox