diff mbox

[RFC] Kconfig: Enable Kconfig fragments to be used for defconfig

Message ID 20100713230352.6781.18644.stgit@angua (mailing list archive)
State New, archived
Headers show

Commit Message

Grant Likely July 13, 2010, 11:04 p.m. UTC
None
diff mbox

Patch

diff --git a/arch/powerpc/configs/mpc5200.Kconfig b/arch/powerpc/configs/mpc5200.Kconfig
new file mode 100644
index 0000000..1281dd1
--- /dev/null
+++ b/arch/powerpc/configs/mpc5200.Kconfig
@@ -0,0 +1,24 @@ 
+config generateconfig_MPC5200_YES
+	def_bool y
+	select PPC_MPC52xx
+	select PPC_MPC5200_SIMPLE
+	select PPC_EFIKA
+	select PPC_LITE5200
+	select PPC_MEDIA5200
+	select PPC_MPC5200_BUGFIX
+	select PPC_MPC5200_GPIO
+	select PPC_MPC5200_LPBFIFO
+	select PPC_BESTCOMM
+	select SIMPLE_GPIO
+	select SERIAL_MPC52xx
+	select SERIAL_MPC52xx_CONSOLE
+	select MTD
+	select PATA_MPC52xx
+	select SPI_MPC52xx
+	select SPI_MPC52xx_PSC
+	select I2C_MPC
+	select FEC_MPC52xx
+	select LXT_PHY
+	select WATCHDOG
+
+source arch/powerpc/configs/ppc32.Kconfig
diff --git a/arch/powerpc/configs/mpc83xx.Kconfig b/arch/powerpc/configs/mpc83xx.Kconfig
new file mode 100644
index 0000000..818fdec
--- /dev/null
+++ b/arch/powerpc/configs/mpc83xx.Kconfig
@@ -0,0 +1,35 @@ 
+config generateconfig_MPC83xx_YES
+	def_bool y
+	select PPC_83xx
+	select EMBEDDED
+	select MPC831x_RDB
+	select MPC832x_MDS
+	select MPC832x_RDB
+	select MPC834x_MDS
+	select MPC834x_ITX
+	select MPC836x_MDS
+	select MPC836x_RDK
+	select MPC837x_MDS
+	select MPC837x_RDB
+	select SBC834x
+	select ASP834x
+	select QUICC_ENGINE
+	select OE_GPIO
+	select MATH_EMULATION
+	select SATA_FSL
+	select SATA_SIL
+	select MARVELL_PHY
+	select DAVICOM_PHY
+	select VITESSE_PHY
+	select ICPLUS_PHY
+	select FIXED_PHY
+	select FSL_PQ_MDIO
+	select GIANFAR
+	select UCC_GETH
+	select SERIAL_8250
+	select SERIAL_8250_CONSOLE
+	select I2C_MPC
+	select GPIOLIB
+	select WATCHDOG
+
+source arch/powerpc/configs/ppc32.Kconfig
diff --git a/arch/powerpc/configs/ppc32.Kconfig b/arch/powerpc/configs/ppc32.Kconfig
new file mode 100644
index 0000000..66e39f0
--- /dev/null
+++ b/arch/powerpc/configs/ppc32.Kconfig
@@ -0,0 +1,39 @@ 
+config generateconfig_PPC32_YES
+	def_bool y
+	select EXPERIMENTAL
+	select DEVTMPFS
+	select PPC32
+	select SYSVIPC
+	select BLK_DEV_INITRD
+	select NO_HZ
+	select HIGH_RES_TIMERS
+	select GPIO
+	select SPI
+	select SPI_SPIDEV
+	select I2C
+	select I2C_CHARDEV
+	select USB
+	select NET
+	select SCSI
+	select BLK_DEV_SD
+	select ATA
+	select PACKET
+	select UNIX
+	select INET
+	select IP_MULTICAST
+	select IP_PNP
+	select IP_PNP_DHCP
+	select NETDEVICES
+	select NET_ETHERNET
+	select PROC_DEVICETREE
+	select INOTIFY
+	select TMPFS
+	select NFS_FS
+	select ROOT_NFS
+	select PRINTK_TIME
+
+config generateconfig_PPC32_MODULE
+	def_tristate m
+
+source arch/powerpc/Kconfig
+
diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index 7ea649d..4e9afd9 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -117,7 +117,23 @@  else
 	$(Q)$< -D arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG) $(Kconfig)
 endif
 
-%_defconfig: $(obj)/conf
+# New-style defconfig using Kconfig fragments
+%_defconfig: $(obj)/conf arch/$(SRCARCH)/configs/%.Kconfig
+	$(Q)$< -D /dev/null arch/$(SRCARCH)/configs/$*.Kconfig
+	$(Q)sed '/^#/d;/^CONFIG_generateconfig_/d' $(objtree)/.config > $(objtree)/.config-diff1
+	$(Q)$< -o $(Kconfig) > /dev/null # oldconfig test to make sure it doesn't change
+	$(Q)sed '/^#/d' $(objtree)/.config > $(objtree)/.config-diff2
+	$(Q)diff -u $(objtree)/.config-diff1 $(objtree)/.config-diff2
+
+# This is kind of useful.  The new-style defconfig using Kconfig fragments
+# can also be used to successively pull in the options a defconfig cares
+# about overtop of the current config.
+%_oldconfig: $(obj)/conf arch/$(SRCARCH)/configs/%.Kconfig
+	$(Q)$< -o arch/$(SRCARCH)/configs/$*.Kconfig
+	$(Q)$< -o $(Kconfig) > /dev/null # oldconfig to clear out the temporary items
+
+# Old-style defconfig using full (or trimmed) .config files.
+%_defconfig: $(obj)/conf arch/$(SRCARCH)/configs/%_defconfig
 	$(Q)$< -D arch/$(SRCARCH)/configs/$@ $(Kconfig)
 
 # Help text used by make help