From: Brent Casavant <bcasavan@sgi.com>

The SGI IOC4 I/O controller chip drivers are currently all configured by
CONFIG_BLK_DEV_SGIIOC4.  This is undesirable as not all IOC4 hardware features
are needed by all systems.

This patch adds two configuration variables, CONFIG_SGI_IOC4 for core IOC4
driver support (see patch 1/3 in this series for further explanation) and
CONFIG_SERIAL_SGI_IOC4 to independently enable serial port support.

Signed-off-by: Brent Casavant <bcasavan@sgi.com>
Acked-by: Pat Gefre <pfg@sgi.com>
Acked-by: Jeremy Higdon <jeremy@sgi.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 arch/ia64/configs/sn2_defconfig |    6 ++++++
 arch/ia64/defconfig             |    6 ++++++
 drivers/Kconfig                 |    2 ++
 drivers/Makefile                |    2 +-
 drivers/ide/Kconfig             |    4 ++--
 drivers/serial/Kconfig          |    9 +++++++++
 drivers/serial/Makefile         |    2 +-
 drivers/sn/Kconfig              |   20 ++++++++++++++++++++
 drivers/sn/Makefile             |    2 +-
 9 files changed, 48 insertions(+), 5 deletions(-)

diff -puN arch/ia64/configs/sn2_defconfig~ioc4-config-split arch/ia64/configs/sn2_defconfig
--- 25/arch/ia64/configs/sn2_defconfig~ioc4-config-split	2005-06-18 02:48:44.000000000 -0700
+++ 25-akpm/arch/ia64/configs/sn2_defconfig	2005-06-18 02:48:44.000000000 -0700
@@ -588,6 +588,7 @@ CONFIG_SGI_MBCS=m
 CONFIG_SERIAL_CORE=y
 CONFIG_SERIAL_CORE_CONSOLE=y
 CONFIG_SERIAL_SGI_L1_CONSOLE=y
+CONFIG_SERIAL_SGI_IOC4=y
 CONFIG_UNIX98_PTYS=y
 CONFIG_LEGACY_PTYS=y
 CONFIG_LEGACY_PTY_COUNT=256
@@ -788,6 +789,11 @@ CONFIG_INFINIBAND_IPOIB=m
 # CONFIG_INFINIBAND_IPOIB_DEBUG is not set
 
 #
+# SN Devices
+#
+CONFIG_SGI_IOC4=y
+
+#
 # File systems
 #
 CONFIG_EXT2_FS=y
diff -puN arch/ia64/defconfig~ioc4-config-split arch/ia64/defconfig
--- 25/arch/ia64/defconfig~ioc4-config-split	2005-06-18 02:48:44.000000000 -0700
+++ 25-akpm/arch/ia64/defconfig	2005-06-18 02:48:44.000000000 -0700
@@ -638,6 +638,7 @@ CONFIG_SERIAL_8250_SHARE_IRQ=y
 CONFIG_SERIAL_CORE=y
 CONFIG_SERIAL_CORE_CONSOLE=y
 CONFIG_SERIAL_SGI_L1_CONSOLE=y
+CONFIG_SERIAL_SGI_IOC4=y
 CONFIG_UNIX98_PTYS=y
 CONFIG_LEGACY_PTYS=y
 CONFIG_LEGACY_PTY_COUNT=256
@@ -943,6 +944,11 @@ CONFIG_INFINIBAND_IPOIB=m
 # CONFIG_INFINIBAND_IPOIB_DEBUG is not set
 
 #
+# SN Devices
+#
+CONFIG_SGI_IOC4=y
+
+#
 # File systems
 #
 CONFIG_EXT2_FS=y
diff -puN drivers/ide/Kconfig~ioc4-config-split drivers/ide/Kconfig
--- 25/drivers/ide/Kconfig~ioc4-config-split	2005-06-18 02:48:44.000000000 -0700
+++ 25-akpm/drivers/ide/Kconfig	2005-06-18 02:48:44.000000000 -0700
@@ -672,8 +672,8 @@ config BLK_DEV_SVWKS
 	  chipsets.
 
 config BLK_DEV_SGIIOC4
-	tristate "Silicon Graphics IOC4 chipset support"
-	depends on IA64_SGI_SN2 || IA64_GENERIC
+	tristate "Silicon Graphics IOC4 chipset ATA/ATAPI support"
+	depends on (IA64_SGI_SN2 || IA64_GENERIC) && SGI_IOC4
 	help
 	  This driver adds PIO & MultiMode DMA-2 support for the SGI IOC4
 	  chipset, which has one channel and can support two devices.
diff -puN drivers/Kconfig~ioc4-config-split drivers/Kconfig
--- 25/drivers/Kconfig~ioc4-config-split	2005-06-18 02:48:44.000000000 -0700
+++ 25-akpm/drivers/Kconfig	2005-06-18 02:48:44.000000000 -0700
@@ -58,4 +58,6 @@ source "drivers/mmc/Kconfig"
 
 source "drivers/infiniband/Kconfig"
 
+source "drivers/sn/Kconfig"
+
 endmenu
diff -puN drivers/Makefile~ioc4-config-split drivers/Makefile
--- 25/drivers/Makefile~ioc4-config-split	2005-06-18 02:48:44.000000000 -0700
+++ 25-akpm/drivers/Makefile	2005-06-18 02:48:44.000000000 -0700
@@ -61,6 +61,6 @@ obj-$(CONFIG_EISA)		+= eisa/
 obj-$(CONFIG_CPU_FREQ)		+= cpufreq/
 obj-$(CONFIG_MMC)		+= mmc/
 obj-$(CONFIG_INFINIBAND)	+= infiniband/
-obj-$(CONFIG_BLK_DEV_SGIIOC4)	+= sn/
+obj-$(CONFIG_SGI_IOC4)		+= sn/
 obj-y				+= firmware/
 obj-$(CONFIG_CRYPTO)		+= crypto/
diff -puN drivers/serial/Kconfig~ioc4-config-split drivers/serial/Kconfig
--- 25/drivers/serial/Kconfig~ioc4-config-split	2005-06-18 02:48:44.000000000 -0700
+++ 25-akpm/drivers/serial/Kconfig	2005-06-18 02:48:44.000000000 -0700
@@ -843,4 +843,13 @@ config SERIAL_JSM
           To compile this driver as a module, choose M here: the
           module will be called jsm.
 
+config SERIAL_SGI_IOC4
+	tristate "SGI IOC4 controller serial support"
+	depends on (IA64_GENERIC || IA64_SGI_SN2) && SGI_IOC4
+	select SERIAL_CORE
+	help
+		If you have an SGI Altix with an IOC4 based Base IO card
+		and wish to use the serial ports on this card, say Y.
+		Otherwise, say N.
+
 endmenu
diff -puN drivers/serial/Makefile~ioc4-config-split drivers/serial/Makefile
--- 25/drivers/serial/Makefile~ioc4-config-split	2005-06-18 02:48:44.000000000 -0700
+++ 25-akpm/drivers/serial/Makefile	2005-06-18 02:48:44.000000000 -0700
@@ -51,4 +51,4 @@ obj-$(CONFIG_ETRAX_SERIAL) += crisv10.o
 obj-$(CONFIG_SERIAL_JSM) += jsm/
 obj-$(CONFIG_SERIAL_TXX9) += serial_txx9.o
 obj-$(CONFIG_SERIAL_VR41XX) += vr41xx_siu.o
-obj-$(CONFIG_BLK_DEV_SGIIOC4) += ioc4_serial.o
+obj-$(CONFIG_SERIAL_SGI_IOC4) += ioc4_serial.o
diff -puN /dev/null drivers/sn/Kconfig
--- /dev/null	2003-09-15 06:40:47.000000000 -0700
+++ 25-akpm/drivers/sn/Kconfig	2005-06-18 02:48:44.000000000 -0700
@@ -0,0 +1,20 @@
+#
+# Miscellaneous SN-specific devices
+#
+
+menu "SN Devices"
+
+config SGI_IOC4
+	tristate "SGI IOC4 Base IO support"
+	depends on IA64_GENERIC || IA64_SGI_SN2
+	default m
+	---help---
+	This option enables basic support for the SGI IOC4-based Base IO
+	controller card.  This option does not enable any specific
+	functions on such a card, but provides necessary infrastructure
+	for other drivers to utilize.
+
+	If you have an SGI Altix with an IOC4-based
+	I/O controller say Y.  Otherwise say N.
+
+endmenu
diff -puN drivers/sn/Makefile~ioc4-config-split drivers/sn/Makefile
--- 25/drivers/sn/Makefile~ioc4-config-split	2005-06-18 02:48:44.000000000 -0700
+++ 25-akpm/drivers/sn/Makefile	2005-06-18 02:48:44.000000000 -0700
@@ -3,4 +3,4 @@
 #
 #
 
-obj-$(CONFIG_BLK_DEV_SGIIOC4) += ioc4.o
+obj-$(CONFIG_SGI_IOC4) += ioc4.o
_