[coreboot] [PATCH] more kconfig support

Peter Stuge peter at stuge.se
Tue Sep 29 01:48:17 CEST 2009


Stefan Reinauer wrote:
> >>> +++ src/cpu/intel/model_1067x/Kconfig	(Revision 0)
> >>> @@ -0,0 +1,5 @@
> >>> +config CPU_INTEL_CORE2
> >>> +	bool
> >>> +	default y
> >>> +	select SMP
> >>> +	select HAVE_MOVNTI
> >>>       
> >> The syntax (i.e. using default y) means that all model_1067x are Core2?
> >> Is that correct?
> >
> > I think so. If not, it should be renamed to CPU_INTEL_MODEL_1067X in
> > my opinion.
> 
> Is that really the implication? I thought it means that if
> model_1067x/Kconfig is loaded, code that belongs to core2 is also
> selected. That's good, and it should be different from the
> assumption that all mode_1067x are core2, even though I think this
> is correct (some might be Atom, though, not 100% sure)

Example from Linux:

--8<-- drivers/parport/Kconfig
if PARPORT
config PARPORT_PC
        tristate "PC-style hardware"
        depends on (!SPARC64 || PCI) && !SPARC32 && !M32R && !FRV && \
                   (!M68K || ISA) && !MN10300 && !AVR32 && !BLACKFIN
..
config PARPORT_PC_FIFO
        bool "Use FIFO/DMA if available (EXPERIMENTAL)"
        depends on PARPORT_PC && EXPERIMENTAL
..
config PARPORT_PC_PCMCIA
        tristate "Support for PCMCIA management for PC-style ports"
        depends on PCMCIA && PARPORT_PC
..
config PARPORT_AMIGA
        tristate "Amiga builtin port"
        depends on AMIGA
        select PARPORT_NOT_PC
..
config PARPORT_AX88796
        tristate "AX88796 Parallel Port"
        select PARPORT_NOT_PC
..
config PARPORT_NOT_PC
        bool

endif # PARPORT
-->8--

--8<-- include/linux/parport.h
/* If PC hardware is the only type supported, we can optimise a bit. 
*/
#if !defined(CONFIG_PARPORT_NOT_PC)

#include <linux/parport_pc.h>
#define parport_write_data(p,x)            parport_pc_write_data(p,x)
#define parport_read_data(p)               parport_pc_read_data(p)
..
#else  /*  !CONFIG_PARPORT_NOT_PC  */

/* Generic operations vector through the dispatch table. */
#define parport_write_data(p,x)            (p)->ops->write_data(p,x)
#define parport_read_data(p)               (p)->ops->read_data(p)
..
#endif /*  !CONFIG_PARPORT_NOT_PC  */
-->8--

We might make more use of Kconfig if in our Kconfigs. But for select,
it seems it does mean that stuff will be defined for the source code.


//Peter




More information about the coreboot mailing list