
From: Ralf Baechle <ralf@linux-mips.org>

 o Delobotomize JMR 3927 interrupt code
 o Remove last remaining bits of code for the Philips Nino

Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/arch/mips/configs/jmr3927_defconfig |   52 ++++++++++++++++++++++++--
 25-akpm/arch/mips/jmr3927/rbhma3100/irq.c   |   55 +++++++++++-----------------
 25-akpm/arch/mips/jmr3927/rbhma3100/setup.c |    2 -
 25-akpm/drivers/video/Makefile              |    2 -
 25-akpm/drivers/video/tx3912fb.c            |   12 ------
 5 files changed, 72 insertions(+), 51 deletions(-)

diff -puN arch/mips/configs/jmr3927_defconfig~mips-tx39-series-updates arch/mips/configs/jmr3927_defconfig
--- 25/arch/mips/configs/jmr3927_defconfig~mips-tx39-series-updates	2005-01-29 11:26:12.113906328 -0800
+++ 25-akpm/arch/mips/configs/jmr3927_defconfig	2005-01-29 11:26:12.125904504 -0800
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.10-rc2
-# Sun Nov 21 14:12:01 2004
+# Linux kernel version: 2.6.11-rc2
+# Wed Jan 26 02:49:06 2005
 #
 CONFIG_MIPS=y
 # CONFIG_MIPS64 is not set
@@ -79,13 +79,13 @@ CONFIG_TOSHIBA_JMR3927=y
 # CONFIG_SNI_RM200_PCI is not set
 # CONFIG_TOSHIBA_RBTX4927 is not set
 CONFIG_RWSEM_GENERIC_SPINLOCK=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
 CONFIG_HAVE_DEC_LOCK=y
 CONFIG_DMA_NONCOHERENT=y
 # CONFIG_CPU_LITTLE_ENDIAN is not set
 CONFIG_MIPS_TX3927=y
 CONFIG_SWAP_IO_SPACE=y
 CONFIG_MIPS_L1_CACHE_SHIFT=5
-CONFIG_FB=y
 CONFIG_TOSHIBA_BOARDS=y
 
 #
@@ -127,6 +127,20 @@ CONFIG_PCI_NAMES=y
 CONFIG_MMU=y
 
 #
+# PCCARD (PCMCIA/CardBus) support
+#
+# CONFIG_PCCARD is not set
+
+#
+# PC-card bridges
+#
+
+#
+# PCI Hotplug Support
+#
+# CONFIG_HOTPLUG_PCI is not set
+
+#
 # Executable file formats
 #
 CONFIG_BINFMT_ELF=y
@@ -142,6 +156,7 @@ CONFIG_TRAD_SIGNALS=y
 #
 CONFIG_STANDALONE=y
 CONFIG_PREVENT_FIRMWARE_BUILD=y
+# CONFIG_FW_LOADER is not set
 
 #
 # Memory Technology Devices (MTD)
@@ -165,10 +180,12 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
 # CONFIG_BLK_CPQ_CISS_DA is not set
 # CONFIG_BLK_DEV_DAC960 is not set
 # CONFIG_BLK_DEV_UMEM is not set
+# CONFIG_BLK_DEV_COW_COMMON is not set
 # CONFIG_BLK_DEV_LOOP is not set
 # CONFIG_BLK_DEV_NBD is not set
 # CONFIG_BLK_DEV_SX8 is not set
 # CONFIG_BLK_DEV_RAM is not set
+CONFIG_BLK_DEV_RAM_COUNT=16
 CONFIG_INITRAMFS_SOURCE=""
 # CONFIG_LBD is not set
 CONFIG_CDROM_PKTCDVD=y
@@ -182,6 +199,7 @@ CONFIG_IOSCHED_NOOP=y
 CONFIG_IOSCHED_AS=y
 CONFIG_IOSCHED_DEADLINE=y
 CONFIG_IOSCHED_CFQ=y
+CONFIG_ATA_OVER_ETH=y
 
 #
 # ATA/ATAPI/MFM/RLL support
@@ -384,6 +402,7 @@ CONFIG_SERIO=y
 CONFIG_SERIO_SERPORT=y
 # CONFIG_SERIO_CT82C710 is not set
 # CONFIG_SERIO_PCIPS2 is not set
+# CONFIG_SERIO_LIBPS2 is not set
 CONFIG_SERIO_RAW=y
 
 #
@@ -409,6 +428,7 @@ CONFIG_SERIAL_NONSTANDARD=y
 # CONFIG_DIGI is not set
 # CONFIG_MOXA_INTELLIO is not set
 # CONFIG_MOXA_SMARTIO is not set
+# CONFIG_ISI is not set
 # CONFIG_SYNCLINK is not set
 # CONFIG_SYNCLINKMP is not set
 # CONFIG_N_HDLC is not set
@@ -452,7 +472,6 @@ CONFIG_LEGACY_PTY_COUNT=256
 #
 # Ftape, the floppy tape device driver
 #
-# CONFIG_AGP is not set
 # CONFIG_DRM is not set
 # CONFIG_RAW_DRIVER is not set
 
@@ -483,6 +502,7 @@ CONFIG_LEGACY_PTY_COUNT=256
 #
 # Graphics support
 #
+CONFIG_FB=y
 # CONFIG_FB_MODE_HELPERS is not set
 # CONFIG_FB_TILEBLITTING is not set
 # CONFIG_FB_CIRRUS is not set
@@ -517,6 +537,7 @@ CONFIG_DUMMY_CONSOLE=y
 # Logo configuration
 #
 # CONFIG_LOGO is not set
+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
 
 #
 # Sound
@@ -531,11 +552,25 @@ CONFIG_USB_ARCH_HAS_HCD=y
 CONFIG_USB_ARCH_HAS_OHCI=y
 
 #
+# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
+#
+
+#
 # USB Gadget Support
 #
 # CONFIG_USB_GADGET is not set
 
 #
+# MMC/SD Card support
+#
+# CONFIG_MMC is not set
+
+#
+# InfiniBand support
+#
+# CONFIG_INFINIBAND is not set
+
+#
 # File systems
 #
 # CONFIG_EXT2_FS is not set
@@ -624,6 +659,11 @@ CONFIG_MSDOS_PARTITION=y
 # CONFIG_NLS is not set
 
 #
+# Profiling support
+#
+# CONFIG_PROFILING is not set
+
+#
 # Kernel hacking
 #
 # CONFIG_DEBUG_KERNEL is not set
@@ -643,6 +683,10 @@ CONFIG_KEYS_DEBUG_PROC_KEYS=y
 # CONFIG_CRYPTO is not set
 
 #
+# Hardware crypto devices
+#
+
+#
 # Library routines
 #
 # CONFIG_CRC_CCITT is not set
diff -puN arch/mips/jmr3927/rbhma3100/irq.c~mips-tx39-series-updates arch/mips/jmr3927/rbhma3100/irq.c
--- 25/arch/mips/jmr3927/rbhma3100/irq.c~mips-tx39-series-updates	2005-01-29 11:26:12.114906176 -0800
+++ 25-akpm/arch/mips/jmr3927/rbhma3100/irq.c	2005-01-29 11:26:12.124904656 -0800
@@ -89,38 +89,10 @@ static unsigned char irc_level[TX3927_NU
 	6, 6, 6			/* TMR */
 };
 
-static inline void mask_irq(unsigned int irq_nr)
-{
-	struct tb_irq_space* sp;
-	for (sp = tb_irq_spaces; sp; sp = sp->next) {
-		if (sp->start_irqno <= irq_nr &&
-		    irq_nr < sp->start_irqno + sp->nr_irqs) {
-			if (sp->mask_func)
-				sp->mask_func(irq_nr - sp->start_irqno,
-					      sp->space_id);
-			break;
-		}
-	}
-}
-
-static inline void unmask_irq(unsigned int irq_nr)
-{
-	struct tb_irq_space* sp;
-	for (sp = tb_irq_spaces; sp; sp = sp->next) {
-		if (sp->start_irqno <= irq_nr &&
-		    irq_nr < sp->start_irqno + sp->nr_irqs) {
-			if (sp->unmask_func)
-				sp->unmask_func(irq_nr - sp->start_irqno,
-						sp->space_id);
-			break;
-		}
-	}
-}
-
 static void jmr3927_irq_disable(unsigned int irq_nr);
 static void jmr3927_irq_enable(unsigned int irq_nr);
 
-static spinlock_t jmr3927_irq_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(jmr3927_irq_lock);
 
 static unsigned int jmr3927_irq_startup(unsigned int irq)
 {
@@ -133,9 +105,8 @@ static unsigned int jmr3927_irq_startup(
 
 static void jmr3927_irq_ack(unsigned int irq)
 {
-	if (irq == JMR3927_IRQ_IRC_TMR0) {
+	if (irq == JMR3927_IRQ_IRC_TMR0)
 		jmr3927_tmrptr->tisr = 0;       /* ack interrupt */
-	}
 
 	jmr3927_irq_disable(irq);
 }
@@ -147,19 +118,37 @@ static void jmr3927_irq_end(unsigned int
 
 static void jmr3927_irq_disable(unsigned int irq_nr)
 {
+	struct tb_irq_space* sp;
 	unsigned long flags;
 
 	spinlock_irqsave(&jmr3927_irq_lock, flags);
-	mask_irq(irq_nr);
+	for (sp = tb_irq_spaces; sp; sp = sp->next) {
+		if (sp->start_irqno <= irq_nr &&
+		    irq_nr < sp->start_irqno + sp->nr_irqs) {
+			if (sp->mask_func)
+				sp->mask_func(irq_nr - sp->start_irqno,
+					      sp->space_id);
+			break;
+		}
+	}
 	spinlock_irqrestore(&jmr3927_irq_lock, flags);
 }
 
 static void jmr3927_irq_enable(unsigned int irq_nr)
 {
+	struct tb_irq_space* sp;
 	unsigned long flags;
 
 	spinlock_irqsave(&jmr3927_irq_lock, flags);
-	unmask_irq(irq_nr);
+	for (sp = tb_irq_spaces; sp; sp = sp->next) {
+		if (sp->start_irqno <= irq_nr &&
+		    irq_nr < sp->start_irqno + sp->nr_irqs) {
+			if (sp->unmask_func)
+				sp->unmask_func(irq_nr - sp->start_irqno,
+						sp->space_id);
+			break;
+		}
+	}
 	spinlock_irqrestore(&jmr3927_irq_lock, flags);
 }
 
diff -puN arch/mips/jmr3927/rbhma3100/setup.c~mips-tx39-series-updates arch/mips/jmr3927/rbhma3100/setup.c
--- 25/arch/mips/jmr3927/rbhma3100/setup.c~mips-tx39-series-updates	2005-01-29 11:26:12.116905872 -0800
+++ 25-akpm/arch/mips/jmr3927/rbhma3100/setup.c	2005-01-29 11:26:12.123904808 -0800
@@ -108,7 +108,7 @@ static inline void do_reset(void)
 
 static void jmr3927_machine_restart(char *command)
 {
-	cli();
+	local_irq_disable();
 	puts("Rebooting...");
 	do_reset();
 }
diff -puN drivers/video/Makefile~mips-tx39-series-updates drivers/video/Makefile
--- 25/drivers/video/Makefile~mips-tx39-series-updates	2005-01-29 11:26:12.117905720 -0800
+++ 25-akpm/drivers/video/Makefile	2005-01-29 11:26:12.123904808 -0800
@@ -82,7 +82,6 @@ obj-$(CONFIG_FB_G364)             += g36
 obj-$(CONFIG_FB_SA1100)           += sa1100fb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o
 obj-$(CONFIG_FB_SUN3)             += sun3fb.o
 obj-$(CONFIG_FB_HIT)              += hitfb.o cfbfillrect.o cfbimgblt.o
-obj-$(CONFIG_FB_TX3912)           += tx3912fb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o
 obj-$(CONFIG_FB_EPSON1355)	  += epson1355fb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o
 obj-$(CONFIG_FB_PVR2)             += pvr2fb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o
 obj-$(CONFIG_FB_VOODOO1)          += sstfb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o
@@ -98,6 +97,7 @@ obj-$(CONFIG_FB_PMAG_AA)	  += pmag-aa-fb
 obj-$(CONFIG_FB_PMAG_BA)	  += pmag-ba-fb.o  cfbfillrect.o cfbcopyarea.o cfbimgblt.o
 obj-$(CONFIG_FB_PMAGB_B)	  += pmagb-b-fb.o  cfbfillrect.o cfbcopyarea.o cfbimgblt.o
 obj-$(CONFIG_FB_MAXINE)		  += maxinefb.o  cfbfillrect.o cfbcopyarea.o cfbimgblt.o
+obj-$(CONFIG_FB_TX3912)		  += tx3912fb.o  cfbfillrect.o cfbcopyarea.o cfbimgblt.o
 
 # Platform or fallback drivers go here
 obj-$(CONFIG_FB_VESA)             += vesafb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o
diff -puN drivers/video/tx3912fb.c~mips-tx39-series-updates drivers/video/tx3912fb.c
--- 25/drivers/video/tx3912fb.c~mips-tx39-series-updates	2005-01-29 11:26:12.119905416 -0800
+++ 25-akpm/drivers/video/tx3912fb.c	2005-01-29 11:26:12.122904960 -0800
@@ -10,7 +10,6 @@
  *
  *  Framebuffer for LCD controller in TMPR3912/05 and PR31700 processors
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
@@ -35,11 +34,7 @@ static u32 cfb8[16];
 
 static struct fb_fix_screeninfo tx3912fb_fix __initdata = {
 	.id =		"tx3912fb",
-#ifdef CONFIG_NINO_16MB
-	.smem_len =	(240 * 320),
-#else
 	.smem_len =	((240 * 320)/2),
-#endif
 	.type =		FB_TYPE_PACKED_PIXELS,
 	.visual =	FB_VISUAL_TRUECOLOR, 
 	.xpanstep =	1,
@@ -53,17 +48,10 @@ static struct fb_var_screeninfo tx3912fb
 	.yres =		320,
 	.xres_virtual =	240,
 	.yres_virtual =	320,
-#ifdef CONFIG_NINO_16MB
-	.bits_per_pixel =8,
-	.red =		{ 5, 3, 0 },	/* RGB 332 */
-	.green =	{ 2, 3, 0 },
-	.blue =		{ 0, 2, 0 },
-#else
 	.bits_per_pixel =4,
 	.red =		{ 0, 4, 0 },	/* ??? */
 	.green =	{ 0, 4, 0 },
 	.blue =		{ 0, 4, 0 },
-#endif
 	.activate =	FB_ACTIVATE_NOW,
 	.width =	-1,
 	.height =	-1,
_
