public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Additional PC-9800 patch for 2.5.47-ac4
@ 2002-11-15 10:00 Osamu Tomita
  2002-11-15 10:48 ` PC-9800 patch for 2.5.47-ac4 pci_ids.h typo fix Osamu Tomita
  0 siblings, 1 reply; 4+ messages in thread
From: Osamu Tomita @ 2002-11-15 10:00 UTC (permalink / raw)
  To: LKML, Linux/98 users ML; +Cc: Alan Cox

Hi.
I've made additional patchset aginst 2.5.47-ac4 to work on PC-9800.
This patchset contains updates for already merged files and patches
not merged but needed for PC-9800.
You can get this patchset from next URL.
http://downloads.sourceforge.jp/linux98/1558/linux98-2.5.47-ac4.patch.tar.bz2
Please try this.

Regards,
Osamu

-- 
Osamu Tomita  sf.jp Linux/98 project
tomita@cinet.co.jp

^ permalink raw reply	[flat|nested] 4+ messages in thread

* PC-9800 patch for 2.5.47-ac4 pci_ids.h typo fix
  2002-11-15 10:00 Additional PC-9800 patch for 2.5.47-ac4 Osamu Tomita
@ 2002-11-15 10:48 ` Osamu Tomita
  2002-11-15 11:03   ` PC-9800 patch for 2.5.47-ac4: Update floppy98.c Osamu Tomita
  2002-11-15 11:27   ` PC-9800 patch for 2.5.47-ac4: Update boot98/* Osamu Tomita
  0 siblings, 2 replies; 4+ messages in thread
From: Osamu Tomita @ 2002-11-15 10:48 UTC (permalink / raw)
  To: LKML; +Cc: Alan Cox

[-- Attachment #1: Type: text/plain, Size: 176 bytes --]

Fix typo in pci_ids.h, already in 2.5.47-ac4.

diffstat:
 include/linux/pci_ids.h |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

-- 
Osamu Tomita
tomita@cinet.co.jp

[-- Attachment #2: pci_ids_h-typo.patch --]
[-- Type: text/plain, Size: 670 bytes --]

--- linux/include/linux/pci_ids.h	Fri Nov 15 12:10:13 2002
+++ linux98/include/linux/pci_ids.h	Fri Nov 15 12:28:04 2002
@@ -468,7 +468,7 @@
 #define PCI_DEVICE_ID_NEC_486		0x0005 /* 486 Like Peripheral Bus Bridge */
 #define PCI_DEVICE_ID_NEC_ACCEL_1	0x0006 /* Graphic Accelerator */
 #define PCI_DEVICE_ID_NEC_UXBUS		0x0007 /* UX-Bus Bridge */
-#define PCI_DEVICE_ID_NEC_ACCEL_2	0x0006 /* Graphic Accelerator */
+#define PCI_DEVICE_ID_NEC_ACCEL_2	0x0008 /* Graphic Accelerator */
 #define PCI_DEVICE_ID_NEC_GRAPH		0x0009 /* PCI-CoreGraph Bridge */
 #define PCI_DEVICE_ID_NEC_VL		0x0016 /* PCI-VL Bridge */
 #define PCI_DEVICE_ID_NEC_STARALPHA2	0x002c /* STAR ALPHA2 */

^ permalink raw reply	[flat|nested] 4+ messages in thread

* PC-9800 patch for 2.5.47-ac4: Update floppy98.c
  2002-11-15 10:48 ` PC-9800 patch for 2.5.47-ac4 pci_ids.h typo fix Osamu Tomita
@ 2002-11-15 11:03   ` Osamu Tomita
  2002-11-15 11:27   ` PC-9800 patch for 2.5.47-ac4: Update boot98/* Osamu Tomita
  1 sibling, 0 replies; 4+ messages in thread
From: Osamu Tomita @ 2002-11-15 11:03 UTC (permalink / raw)
  To: LKML; +Cc: Alan Cox

[-- Attachment #1: Type: text/plain, Size: 275 bytes --]

This patch updates floppy driver for PC-9800.
Synchronized with latest drivers/block/floppy.c.

diffstat:
 drivers/block/floppy98.c |   57 ++++++++++++++++++++++++++++-------------------
 1 files changed, 34 insertions(+), 23 deletions(-)

-- 
Osamu Tomita
tomita@cinet.co.jp

[-- Attachment #2: floppy.patch --]
[-- Type: text/plain, Size: 5361 bytes --]

--- linux-2.5.47-ac1/drivers/block/floppy98.c.ac1	Wed Nov 13 09:25:33 2002
+++ linux-2.5.47-ac1/drivers/block/floppy98.c	Wed Nov 13 10:28:40 2002
@@ -176,7 +176,15 @@
 
 
 #include <linux/fd.h>
+#define FLOPPY98_MOTOR_MASK 0x08
+
+#define FDPATCHES
 #include <linux/hdreg.h>
+#define FD98_STATUS	(0 + FD_IOPORT )
+#define FD98_DATA	(2 + FD_IOPORT )
+#define FD_MODE		(4 + FD_IOPORT )
+#define FD_MODE_CHANGE	0xbe
+#define FD_EMODE_CHANGE	0x4be
 
 #include <linux/errno.h>
 #include <linux/slab.h>
@@ -585,7 +593,7 @@
 static void floppy_start(void);
 static void process_fd_request(void);
 static void recalibrate_floppy(void);
-static void floppy_shutdown(void);
+static void floppy_shutdown(unsigned long);
 
 static int floppy_grab_irq_and_dma(void);
 static void floppy_release_irq_and_dma(void);
@@ -659,7 +667,7 @@
 }
 
 typedef void (*timeout_fn)(unsigned long);
-static struct timer_list fd_timeout ={ function: (timeout_fn) floppy_shutdown };
+static struct timer_list fd_timeout = TIMER_INITIALIZER(floppy_shutdown, 0, 0);
 
 static const char *timeout_message;
 
@@ -784,10 +792,10 @@
 		fd_outb(newdor, FD_MODE);
 	}
 
-	if (newdor & FLOPPY_MOTOR_MASK)
+	if (newdor & FLOPPY98_MOTOR_MASK)
 		floppy_grab_irq_and_dma();
 
-	if (olddor & FLOPPY_MOTOR_MASK)
+	if (olddor & FLOPPY98_MOTOR_MASK)
 		floppy_release_irq_and_dma();
 
 	return olddor;
@@ -828,7 +836,7 @@
 	if (FDCS->rawcmd == 2)
 		reset_fdc_info(1);
 
-	if (fd_inb(FD_STATUS) != STATUS_READY)
+	if (fd_inb(FD98_STATUS) != STATUS_READY)
 		FDCS->reset = 1;
 }
 
@@ -991,7 +999,7 @@
 	schedule_work(&floppy_work);
 }
 
-static struct timer_list fd_timer;
+static struct timer_list fd_timer = TIMER_INITIALIZER(NULL, 0, 0);
 
 static void cancel_activity(void)
 {
@@ -1146,7 +1154,7 @@
 	if (FDCS->reset)
 		return -1;
 	for (counter = 0; counter < READY_DELAY; counter++) {
-		status = fd_inb(FD_STATUS);		
+		status = fd_inb(FD98_STATUS);		
 		if (status & STATUS_READY)
 			return status;
 	}
@@ -1167,7 +1175,7 @@
 	if ((status = wait_til_ready()) < 0)
 		return -1;
 	if ((status & (STATUS_READY|STATUS_DIR|STATUS_DMA)) == STATUS_READY){
-		fd_outb(byte,FD_DATA);
+		fd_outb(byte,FD98_DATA);
 #ifdef FLOPPY_SANITY_CHECK
 		output_log[output_log_pos].data = byte;
 		output_log[output_log_pos].status = status;
@@ -1203,7 +1211,7 @@
 			return i;
 		}
 		if (status == (STATUS_DIR|STATUS_READY|STATUS_BUSY))
-			reply_buffer[i] = fd_inb(FD_DATA);
+			reply_buffer[i] = fd_inb(FD98_DATA);
 		else
 			break;
 	}
@@ -1793,7 +1801,7 @@
 	printk("\n");
 #endif
 
-	printk("status=%x\n", fd_inb(FD_STATUS));
+	printk("status=%x\n", fd_inb(FD98_STATUS));
 	printk("fdc_busy=%lu\n", fdc_busy);
 	if (do_floppy)
 		printk("do_floppy=%p\n", do_floppy);
@@ -1812,7 +1820,7 @@
 	printk("\n");
 }
 
-static void floppy_shutdown(void)
+static void floppy_shutdown(unsigned long data)
 {
 	unsigned long flags;
 	
@@ -2198,15 +2206,16 @@
 		DRS->track = NEED_2_RECAL;
 }
 
-static void set_floppy(kdev_t device)
+static void set_floppy(int drive)
 {
-	if (TYPE(device)) {
+	int type = ITYPE(UDRS->fd_device);
+	if (type) {
 		auto_detect_mode = 0;
-		_floppy = TYPE(device) + floppy_type;
+		_floppy = floppy_type + type;
 	} else if (auto_detect_mode == 0) {
 		auto_detect_mode = 1;
 		retry_auto_detect = 0;
-		_floppy = current_type[DRIVE(device)];
+		_floppy = current_type[drive];
 	}
 #ifdef PC9800_DEBUG_FLOPPY2
 	printk("set_floppy: set floppy type=%d\n", (int)(_floppy - floppy_type));
@@ -2316,7 +2325,7 @@
 	int drive=DRIVE(device);
 
 	LOCK_FDC(drive,1);
-	set_floppy(device);
+	set_floppy(drive);
 	if (!_floppy ||
 	    _floppy->track > DP->tracks ||
 	    tmp_format_req->track >= _floppy->track ||
@@ -2344,7 +2353,7 @@
 {
 	if (end_that_request_first(req, uptodate, current_count_sectors))
 		return;
-	add_blkdev_randomness(MAJOR_NR);
+	add_disk_randomness(req->rq_disk);
 	floppy_off((int)req->rq_disk->private_data);
 	blkdev_dequeue_request(req);
 	end_that_request_last(req);
@@ -2678,7 +2687,7 @@
 		return 0;
 	}
 
-	set_fdc(DRIVE(current_req->rq_dev));
+	set_fdc((int)current_req->rq_disk->private_data);
 
 	raw_cmd = &default_raw_cmd;
 	raw_cmd->flags = FD_RAW_SPIN | FD_RAW_NEED_DISK | FD_RAW_NEED_DISK |
@@ -2949,7 +2958,7 @@
 static void redo_fd_request(void)
 {
 #define REPEAT {request_done(0); continue; }
-	kdev_t device;
+	int drive;
 	int tmp;
 
 	lastredo = jiffies;
@@ -2966,11 +2975,11 @@
 			}
 			current_req = req;
 		}
-		device = current_req->rq_dev;
-		set_fdc(DRIVE(device));
+		drive = (int)current_req->rq_disk->private_data;
+		set_fdc(drive);
 		reschedule_timeout(current_reqD, "redo fd request", 0);
 
-		set_floppy(device);
+		set_floppy(drive);
 		raw_cmd = & default_raw_cmd;
 		raw_cmd->flags = 0;
 		if (start_motor(redo_fd_request)) return;
@@ -3665,7 +3674,7 @@
 			if (type)
 				return -EINVAL;
 			LOCK_FDC(drive,1);
-			set_floppy(device);
+			set_floppy(drive);
 			CALL(i = raw_cmd_ioctl(cmd,(void *) param));
 			process_fd_request();
 			return i;
@@ -4251,6 +4260,7 @@
 	int err;
 
 	raw_cmd = NULL;
+	FDC1 = 0x90;
 
 	for (i=0; i<N_DRIVE; i++) {
 		disks[i] = alloc_disk(1);
@@ -4372,6 +4382,7 @@
 	}
 	
 	for (drive = 0; drive < N_DRIVE; drive++) {
+		init_timer(&motor_off_timer[drive]);
 		motor_off_timer[drive].data = drive;
 		motor_off_timer[drive].function = motor_off_callback;
 		if (!(allowed_drive_mask & (1 << drive)))

^ permalink raw reply	[flat|nested] 4+ messages in thread

* PC-9800 patch for 2.5.47-ac4: Update boot98/*
  2002-11-15 10:48 ` PC-9800 patch for 2.5.47-ac4 pci_ids.h typo fix Osamu Tomita
  2002-11-15 11:03   ` PC-9800 patch for 2.5.47-ac4: Update floppy98.c Osamu Tomita
@ 2002-11-15 11:27   ` Osamu Tomita
  1 sibling, 0 replies; 4+ messages in thread
From: Osamu Tomita @ 2002-11-15 11:27 UTC (permalink / raw)
  To: LKML; +Cc: Alan Cox

[-- Attachment #1: Type: text/plain, Size: 440 bytes --]

This patch updates files under arch/i386/boot98/, already in 2.5.47-ac4.
Synchronized with changes of arch/i386/boot/*.

diffstat:
 arch/i386/boot98/Makefile          |    2 +-
 arch/i386/boot98/compressed/head.S |    8 ++++----
 arch/i386/boot98/compressed/misc.c |    6 +++++-
 arch/i386/boot98/setup.S           |   29 ++++++++++++++++++++---------
 4 files changed, 30 insertions(+), 15 deletions(-)

-- 
Osamu Tomita
tomita@cinet.co.jp

[-- Attachment #2: boot98.patch --]
[-- Type: text/plain, Size: 4748 bytes --]

diff -urN linux-2.5.45-ac1/arch/i386/boot98/Makefile linux98-2.5.45-ac1/arch/i386/boot98/Makefile
--- linux-2.5.45-ac1/arch/i386/boot98/Makefile	Wed Nov  6 16:07:08 2002
+++ linux98-2.5.45-ac1/arch/i386/boot98/Makefile	Thu Oct 31 09:42:28 2002
@@ -46,7 +46,7 @@
 $(obj)/bzImage: EXTRA_AFLAGS := -traditional $(SVGA_MODE) $(RAMDISK) -D__BIG_KERNEL__
 $(obj)/bzImage: BUILDFLAGS   := -b
 
-quiet_cmd_image = BUILD   $(echo_target)
+quiet_cmd_image = BUILD   $@
 cmd_image = $(obj)/tools/build $(BUILDFLAGS) $(obj)/bootsect $(obj)/setup \
 	    $(obj)/vmlinux.bin $(ROOT_DEV) > $@
 
diff -urN linux-2.5.45-ac1/arch/i386/boot98/compressed/head.S linux98-2.5.45-ac1/arch/i386/boot98/compressed/head.S
--- linux-2.5.45-ac1/arch/i386/boot98/compressed/head.S	Wed Nov  6 16:07:08 2002
+++ linux98-2.5.45-ac1/arch/i386/boot98/compressed/head.S	Tue Nov  5 10:16:17 2002
@@ -31,7 +31,7 @@
 startup_32:
 	cld
 	cli
-	movl $(__KERNEL_DS),%eax
+	movl $(__BOOT_DS),%eax
 	movl %eax,%ds
 	movl %eax,%es
 	movl %eax,%fs
@@ -74,7 +74,7 @@
 	popl %esi	# discard address
 	popl %esi	# real mode pointer
 	xorl %ebx,%ebx
-	ljmp $(__KERNEL_CS), $0x100000
+	ljmp $(__BOOT_CS), $0x100000
 
 /*
  * We come here, if we were loaded high.
@@ -101,7 +101,7 @@
 	popl %eax	# hcount
 	movl $0x100000,%edi
 	cli		# make sure we don't get interrupted
-	ljmp $(__KERNEL_CS), $0x1000 # and jump to the move routine
+	ljmp $(__BOOT_CS), $0x1000 # and jump to the move routine
 
 /*
  * Routine (template) for moving the decompressed kernel in place,
@@ -124,5 +124,5 @@
 	movsl
 	movl %ebx,%esi	# Restore setup pointer
 	xorl %ebx,%ebx
-	ljmp $(__KERNEL_CS), $0x100000
+	ljmp $(__BOOT_CS), $0x100000
 move_routine_end:
diff -urN linux-2.5.45-ac1/arch/i386/boot98/compressed/misc.c linux98-2.5.45-ac1/arch/i386/boot98/compressed/misc.c
--- linux-2.5.45-ac1/arch/i386/boot98/compressed/misc.c	Wed Nov  6 16:07:08 2002
+++ linux98-2.5.45-ac1/arch/i386/boot98/compressed/misc.c	Wed Nov  6 15:10:28 2002
@@ -301,7 +301,7 @@
 struct {
 	long * a;
 	short b;
-	} stack_start = { & user_stack [STACK_SIZE] , __KERNEL_DS };
+	} stack_start = { & user_stack [STACK_SIZE] , __BOOT_DS };
 
 static void setup_normal_output_buffer(void)
 {
@@ -373,3 +373,7 @@
 	if (high_loaded) close_output_buffer_if_we_run_high(mv);
 	return high_loaded;
 }
+
+/* We don't actually check for stack overflows this early. */
+__asm__(".globl mcount ; mcount: ret\n");
+
diff -urN linux-2.5.45-ac1/arch/i386/boot98/setup.S linux98-2.5.45-ac1/arch/i386/boot98/setup.S
--- linux-2.5.45-ac1/arch/i386/boot98/setup.S	Wed Nov  6 16:07:08 2002
+++ linux98-2.5.45-ac1/arch/i386/boot98/setup.S	Wed Nov  6 15:23:42 2002
@@ -660,7 +660,7 @@
 	subw	$DELTA_INITSEG, %si
 	shll	$4, %esi			# Convert to 32-bit pointer
 # NOTE: For high loaded big kernels we need a
-#	jmpi    0x100000,__KERNEL_CS
+#	jmpi    0x100000,__BOOT_CS
 #
 #	but we yet haven't reloaded the CS register, so the default size 
 #	of the target offset still is 16 bit.
@@ -671,7 +671,7 @@
 	.byte 0x66, 0xea			# prefix + jmpi-opcode
 code32:	.long	0x1000				# will be set to 0x100000
 						# for big kernels
-	.word	__KERNEL_CS
+	.word	__BOOT_CS
 
 # Here's a bunch of information about your current kernel..
 kernel_version:	.ascii	UTS_RELEASE
@@ -902,13 +902,19 @@
 
 # Descriptor tables
 #
-# NOTE: if you think the GDT is large, you can make it smaller by just
-# defining the KERNEL_CS and KERNEL_DS entries and shifting the gdt
-# address down by GDT_ENTRY_KERNEL_CS*8. This puts bogus entries into
-# the GDT, but those wont be used so it's not a problem.
+# NOTE: The intel manual says gdt should be sixteen bytes aligned for
+# efficiency reasons.  However, there are machines which are known not
+# to boot with misaligned GDTs, so alter this at your peril!  If you alter
+# GDT_ENTRY_BOOT_CS (in asm/segment.h) remember to leave at least two
+# empty GDT entries (one for NULL and one reserved).
 #
+# NOTE:	On some CPUs, the GDT must be 8 byte aligned.  This is
+# true for the Voyager Quad CPU card which will not boot without
+# This directive.  16 byte aligment is recommended by intel.
+#
+	.align 16
 gdt:
-	.fill GDT_ENTRY_KERNEL_CS,8,0
+	.fill GDT_ENTRY_BOOT_CS,8,0
 
 	.word	0xFFFF				# 4Gb - (0x100000*0x1000 = 4Gb)
 	.word	0				# base address = 0
@@ -921,12 +927,17 @@
 	.word	0x9200				# data read/write
 	.word	0x00CF				# granularity = 4096, 386
 						#  (+5th nibble of limit)
+gdt_end:
+	.align	4
+	
+	.word	0				# alignment byte
 idt_48:
 	.word	0				# idt limit = 0
 	.word	0, 0				# idt base = 0L
-gdt_48:
-	.word	GDT_ENTRY_KERNEL_CS*8 + 16 - 1	# gdt limit
 
+	.word	0				# alignment byte
+gdt_48:
+	.word	gdt_end - gdt - 1		# gdt limit
 	.word	0, 0				# gdt base (filled in later)
 
 # Include video setup & detection code

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-11-15 11:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-11-15 10:00 Additional PC-9800 patch for 2.5.47-ac4 Osamu Tomita
2002-11-15 10:48 ` PC-9800 patch for 2.5.47-ac4 pci_ids.h typo fix Osamu Tomita
2002-11-15 11:03   ` PC-9800 patch for 2.5.47-ac4: Update floppy98.c Osamu Tomita
2002-11-15 11:27   ` PC-9800 patch for 2.5.47-ac4: Update boot98/* Osamu Tomita

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox