[U-Boot] "CONFIG_*" versus "CONFIG_SYS_*" variables in u-boot?

Robert P. J. Day rpjday at crashcourse.ca
Thu Sep 29 16:27:43 CEST 2016


  from README file:

  There are two classes of configuration variables:

  * Configuration _OPTIONS_:
    These are selectable by the user and have names beginning with
    "CONFIG_".

  * Configuration _SETTINGS_:
    These depend on the hardware etc. and should not be meddled with if
    you don't know what you're doing; they have names beginning with
    "CONFIG_SYS_".

historically, i've always understood (from kernel stuff) that
macros that begin with "CONFIG_" should *always* be user-selectable
through the Kbuild system. so i'm not sure how to interpret a
"CONFIG_SYS_"  prefix.

  i ask given a couple examples i just ran across. first, this
regarding the macro "CONFIG_MAC_OFFSET":

board/cm5200/cm5200.c:	if (i2c_read(CONFIG_SYS_I2C_EEPROM, CONFIG_MAC_OFFSET, 2, buf, 6) == 0) {
board/cm5200/cm5200.c:			CONFIG_MAC_OFFSET);
include/configs/cm5200.h:#define CONFIG_MAC_OFFSET	0x35	/* MAC address offset in I2C EEPROM */

to me, that *clearly* should not have used "CONFIG_MAC_OFFSET", but
rather just "MAC_OFFSET."

  the second example, though, is not quite as clear:

board/pdm360ng/pdm360ng.c:			       CONFIG_SYS_I2C_EEPROM_MAC_OFFSET, 1, buf, 6);
board/pdm360ng/pdm360ng.c:				CONFIG_SYS_I2C_EEPROM_MAC_OFFSET);
include/configs/pdm360ng.h:#define CONFIG_SYS_I2C_EEPROM_MAC_OFFSET	0x10

so even though this second example is also not defined by the Kbuild
system, is it somehow more acceptable because it begins with
"CONFIG_SYS_"? i'm having trouble appreciating the distinction.

rday

-- 

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

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



More information about the U-Boot mailing list