PC-9800 addtional for 2.5.50-ac1
Subsystems (14)
PATCH 1/1 PC-9800 addtional for 2.5.50-ac1
NEC PC-9800 subarchitecture support patch updated. This is additional patch for 2.5.50-ac1, containing updates for already merged files and not merged patch. You can get whole patchset from this URL.
http://downloads.sourceforge.jp/linux98/1838/linux98-2.5.50-ac1.patch.tar.bz2
Regards,
Osamu Tomita
PATCH 1/1 PC-9800 addtional for 2.5.50-ac1 (1/21)
NEC PC-9800 subarchitecture support patch for 2.5.50-ac1(1/21) This is updates for drivers/block/floppy98.c. Synchronized with floppy.c in 2.5.50.
diffstat:
drivers/block/floppy98.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletion(-)
Regards,
Osamu Tomita
drivers/block/floppy98.c +2 -1
@@ -167,6 +167,7 @@#include <linux/kernel.h> #include <linux/timer.h> #include <linux/workqueue.h> +#include <linux/version.h> #define FDPATCHES #include <linux/fdreg.h>
@@ -3354,7 +3355,7 @@static int invalidate_drive (struct block_device *bdev) {/* invalidate the buffer track to force a reread */ -set_bit (DRIVE (to_kdev_t (bdev->bd_dev)), &fake_change); +set_bit ((int )bdev->bd_disk->private_data, &fake_change);process_fd_request ();check_disk_change (bdev);return 0 ;
Re: [PATCHSET] PC-9800 addtional for 2.5.50-ac1 (2/21)
In reply to Osamu TomitaNEC PC-9800 subarchitecture support patch for 2.5.50-ac1 (2/21) This is updates for include/asm-i386/gdc.h.
Killed warning from gcc-3.2.
diffstat:
include/asm-i386/gdc.h | 144 ++++++++++++++++++++++++++----------------------- 1 files changed, 79 insertions(+), 65 deletions(-)
Regards,
Osamu Tomita
PATCH 1/1 PC-9800 addtional for 2.5.50-ac1 (2/21)
In reply to Osamu TomitaThis is re-send. Sorry, I forgot attachment.
NEC PC-9800 subarchitecture support patch for 2.5.50-ac1 (2/21) This is updates for include/asm-i386/gdc.h.
Killed warning from gcc-3.2.
diffstat:
include/asm-i386/gdc.h | 144 ++++++++++++++++++++++++++----------------------- 1 files changed, 79 insertions(+), 65 deletions(-)
Regards,
Osamu Tomita
include/asm-i386/gdc.h renamed from include/asm-i386/gdc.h.old +79 -65
@@ -55,26 +55,29 @@ _scr_memsetw(u16 *s, u16 c, unsigned int count) {#ifdef CONFIG_GDC_32BITACCESS - __asm__ __volatile__ ("shr%L1 %1 - jz 2f -" /* cld kernel code now assumes DF = 0 any time */ "\ - test%L0 %3,%0 - jz 1f - stos%W2 - dec%L1 %1 -1: shr%L1 %1 - rep - stos%L2 - jnc 2f - stos%W2 - rep - stos%W2 -2:" + __asm__ __volatile__ ( +"shr%L1 %1\n\t" +"jz 2f\n\t" +/* "cld\n\t" kernel code now assumes DF = 0 any time */ +"test%L0 %3,%0\n\t" +"jz 1f\n\t" +"stos%W2\n\t" +"dec%L1 %1\n" +"1: shr%L1 %1\n\t" +"rep\n\t" +"stos%L2\n\t" +"jnc 2f\n\t" +"stos%W2\n\t" +"rep\n\t" +"stos%W2\n" +"2:" :"=D" (s),"=c" (count) :"a" ((((u32 ) c) <<16 ) | c),"g" (2 ),"0" (s),"1" (count));#else - __asm__ __volatile__ ("rep\n\tstosw" + __asm__ __volatile__ ( +"rep\n\t" +"stosw" :"=D" (s),"=c" (count) :"0" (s),"1" (count /2 ),"a" (c));#endif
@@ -92,23 +95,26 @@ _scr_memcpyw(u16 *d, u16 *s, unsigned int count) {#if 1 /* def CONFIG_GDC_32BITACCESS */ - __asm__ __volatile__ ("shr%L2 %2 - jz 2f -" /* cld */ "\ - test%L0 %3,%0 - jz 1f - movs%W0 - dec%L2 %2 -1: shr%L2 %2 - rep - movs%L0 - jnc 2f - movs%W0 -2:" + __asm__ __volatile__ ( +"shr%L2 %2\n\t" +"jz 2f\n\t" +/* "cld\n\t" */ +"test%L0 %3,%0\n\t" +"jz 1f\n\t" +"movs%W0\n\t" +"dec%L2 %2\n" +"1: shr%L2 %2\n\t" +"rep\n\t" +"movs%L0\n\t" +"jnc 2f\n\t" +"movs%W0\n" +"2:" :"=D" (d),"=S" (s),"=c" (count) :"g" (2 ),"0" (d),"1" (s),"2" (count));#else - __asm__ __volatile__ ("rep\n\tmovsw" + __asm__ __volatile__ ( +"rep\n\t" +"movsw" :"=D" (d),"=S" (s),"=c" (count) :"0" (d),"1" (s),"2" (count /2 ));#endif
@@ -126,30 +132,35 @@#if 1 /* def CONFIG_GDC_32BITACCESS */ u16 tmp; - __asm__ __volatile__ ("shr%L3 %3 - jz 2f - std - lea%L1 -4(%1,%3,2),%1 - lea%L2 -4(%2,%3,2),%2 - test%L1 %4,%1 - jz 1f - mov%W0 2(%2),%0 - sub%L2 %4,%2 - dec%L3 %3 - mov%W0 %0,2(%1) - sub%L1 %4,%1 -1: shr%L3 %3 - rep - movs%L0 - jnc 3f - mov%W0 2(%2),%0 - mov%W0 %0,2(%1) -3: cld -2:" + __asm__ __volatile__ ( +"shr%L3 %3\n\t" +"jz 2f\n\t" +"std\n\t" +"lea%L1 -4(%1,%3,2),%1\n\t" +"lea%L2 -4(%2,%3,2),%2\n\t" +"test%L1 %4,%1\n\t" +"jz 1f\n\t" +"mov%W0 2(%2),%0\n\t" +"sub%L2 %4,%2\n\t" +"dec%L3 %3\n\t" +"mov%W0 %0,2(%1)\n\t" +"sub%L1 %4,%1\n" +"1: shr%L3 %3\n\t" +"rep\n\t" +"movs%L0\n\t" +"jnc 3f\n\t" +"mov%W0 2(%2),%0\n\t" +"mov%W0 %0,2(%1)\n" +"3: cld\n" +"2:" :"=r" (tmp),"=D" (d),"=S" (s),"=c" (count) :"g" (2 ),"1" (d),"2" (s),"3" (count));#else - __asm__ __volatile__ ("std\n\trep\n\tmovsw\n\tcld" + __asm__ __volatile__ ( +"std\n\t" +"rep\n\t" +"movsw\n\t" +"cld" :"=D" (d),"=S" (s),"=c" (count) :"0" ((void *) d + count -2 ),"1" ((void *) s + count -2 ),"2" (count /2 ));
@@ -179,23 +190,26 @@#ifdef CONFIG_GDC_32BITACCESS /* VRAM is quite slow, so we align source pointer (%esi) to double-word alignment. */ - __asm__ __volatile__ ("shr%L2 %2 - jz 2f -" /* cld */ "\ - test%L0 %3,%0 - jz 1f - movs%W0 - dec%L2 %2 -1: shr%L2 %2 - rep - movs%L0 - jnc 2f - movs%W0 -2:" + __asm__ __volatile__ ( +"shr%L2 %2\n\t" +"jz 2f\n\t" +/* "cld\n\t" */ +"test%L0 %3,%0\n\t" +"jz 1f\n\t" +"movs%W0\n\t" +"dec%L2 %2\n" +"1: shr%L2 %2\n\t" +"rep\n\t" +"movs%L0\n\t" +"jnc 2f\n\t" +"movs%W0\n" +"2:" :"=D" (d),"=S" (s),"=c" (count) :"g" (2 ),"0" (d),"1" (s),"2" (count));#else - __asm__ __volatile__ ("rep\n\tmovsw" + __asm__ __volatile__ ( +"rep\n\t" +"movsw" :"=D" (d),"=S" (s),"=c" (count) :"0" (d),"1" (s),"2" (count /2 ));#endif
PATCH 1/1 PC-9800 addtional for 2.5.50-ac1 (3/21)
In reply to Osamu TomitaNEC PC-9800 subarchitecture support patch for 2.5.50-ac1(3/21) This is updates for drivers/char/lp_old98.c
Done bug Fix and cleanup.
diffstat:
drivers/char/lp_old98.c | 140 ++++++++++++++++++++++-------------------------- 1 files changed, 67 insertions(+), 73 deletions(-)
Regards,
Osamu Tomita
drivers/char/lp_old98.c renamed from drivers/char/lp_old98.c.98 +67 -73
@@ -17,7 +17,8 @@#include <linux/kernel.h> #include <linux/major.h> #include <linux/sched.h> -#include <linux/malloc.h> +#include <linux/slab.h> +#include <linux/spinlock.h> #include <linux/ioport.h> #include <linux/fcntl.h> #include <linux/delay.h>
@@ -32,23 +33,15 @@#error This driver works only for NEC PC-9800 series#endif -#if LINUX_VERSION_CODE <0x20200 -# define LP_STATS -#endif - -#if LINUX_VERSION_CODE >=0x2030b -# define CONFIG_RESOURCE98 -#endif -#include <linux/lp.h> /* * I/O port numbers */ #define LP_PORT_DATA 0x40 -#define LP_PORT_STATUS (LP_PORT_DATA+2) -#define LP_PORT_STROBE (LP_PORT_DATA+4) -#define LP_PORT_CONTROL (LP_PORT_DATA+6) +#define LP_PORT_STATUS (LP_PORT_DATA + 2) +#define LP_PORT_STROBE (LP_PORT_DATA + 4) +#define LP_PORT_CONTROL (LP_PORT_DATA + 6)#define LP_PORT_H98MODE 0x0448#define LP_PORT_EXTMODE 0x0149
@@ -73,27 +66,27 @@/* PC-9800s have at least and at most one old-style printer port. */ static struct lp_struct lp = {/* Following `TAG: INITIALIZER' notations are GNU CC extension. */ - flags:LP_EXIST |LP_ABORTOPEN , - chars:LP_INIT_CHAR , - time:LP_INIT_TIME , - wait:LP_INIT_WAIT , + .flags =LP_EXIST |LP_ABORTOPEN , + .chars =LP_INIT_CHAR , + .time =LP_INIT_TIME , + .wait =LP_INIT_WAIT , };static int dc1_check =1000 ; +static spinlock_t lp_old98_lock =SPIN_LOCK_UNLOCKED ; -#undef LP_OLD98_DEBUG -#ifndef __udelay_val -# define __udelay_val current_cpu_data.loops_per_sec -#endif +#undef LP_OLD98_DEBUGstatic inline void nanodelay (unsigned long nanosecs)/* Evil ? */ { -if ( nanosecs ) { - nanosecs *= (unsigned long )((1ULL <<40 ) /1000000000ULL ); - __asm__("mul%L2 %2" - :"=d" (nanosecs) :"a" (nanosecs),"g" (__udelay_val)); -__delay (nanosecs >>8 ); +if (nanosecs) { +int d0; + nanosecs = (nanosecs *512UL ) /119UL ; + __asm__("mull %0" + :"=d" (nanosecs),"=&a" (d0) + :"1" (nanosecs),"0" (current_cpu_data.loops_per_jiffy)); +__delay (nanosecs *HZ ); } }
@@ -118,15 +111,14 @@ } } -static inline int -lp_old98_wait_ready (void ) +static inline int lp_old98_wait_ready (void ) {struct timer_list timer;init_timer (&timer); timer.function = lp_old98_timer_function; timer.expires = jiffies +1 ; - timer.data = (unsigned long ) &timer; + timer.data = (unsigned long )&timer;add_timer (&timer);interruptible_sleep_on (&lp_old98_waitq);del_timer (&timer);
@@ -140,7 +132,7 @@int tmp;#endif -while ( !(inb (LP_PORT_STATUS ) & LP_MASK_nBUSY) ) { +while (!(inb (LP_PORT_STATUS ) & LP_MASK_nBUSY)) { count++;if (count >= lp.chars)return 0 ;
@@ -153,7 +145,7 @@* Update lp statsistics here (and between next two outb()'s). * Time to compute it is part of storobe delay. */ -if ( count > lp.stats.maxwait ) { +if (count > lp.stats.maxwait) {#ifdef LP_OLD98_DEBUG printk (KERN_DEBUG "lp_old98: success after %d counts.\n" , count);
@@ -162,7 +154,7 @@ } count *=256 ; tmp = count - lp.stats.meanwait; -if ( tmp <0 ) +if (tmp <0 ) tmp = -tmp;#endif nanodelay (lp.wait);
@@ -173,7 +165,7 @@#ifdef LP_STATS lp.stats.meanwait = (255 * lp.stats.meanwait + count +128 ) /256 ; lp.stats.mdev = (127 * lp.stats.mdev + tmp +64 ) /128 ; - lp.stats.chars++; + lp.stats.chars ++;#endif nanodelay (lp.wait);
@@ -199,7 +191,7 @@return -EFAULT ;#ifdef LP_STATS -if ( jiffies - lp.lastcall > lp.time ) +if (jiffies - lp.lastcall > lp.time) lp.runchars =0 ; lp.lastcall = jiffies;#endif
@@ -212,17 +204,17 @@if (__copy_from_user (lp.lp_buffer, buf, copy_size))return -EFAULT ; -while ( bytes_written < copy_size ) { -if (lp_old98_char (lp.lp_buffer[bytes_written]) ) - bytes_written++; +while (bytes_written < copy_size) { +if (lp_old98_char (lp.lp_buffer[bytes_written])) + bytes_written ++;else {#ifdef LP_STATS int rc = lp.runchars + bytes_written; -if ( rc > lp.stats.maxrun ) +if (rc > lp.stats.maxrun) lp.stats.maxrun = rc; - lp.stats.sleeps++; + lp.stats.sleeps ++;#endif #ifdef LP_OLD98_DEBUG printk(KERN_DEBUG
@@ -243,7 +235,7 @@ lp.runchars += bytes_written;#endif count -= bytes_written; - }while ( count >0 ); + }while (count >0 );return total_bytes_written; }
@@ -256,16 +248,16 @@static int lp_old98_open (struct inode * inode,struct file * file) { -if (MINOR (inode->i_rdev) !=0 ) +if (minor (inode->i_rdev) !=0 )return -ENXIO ; -if ( lp.flags &LP_BUSY ) +if (lp.flags &LP_BUSY )return -EBUSY ;if ((lp.lp_buffer =kmalloc (LP_BUFFER_SIZE ,GFP_KERNEL )) ==NULL )return -ENOMEM ;if (dc1_check && (lp.flags &LP_ABORTOPEN ) - && !(file->f_flags &O_NONBLOCK ) ) { + && !(file->f_flags &O_NONBLOCK )) {/* * Check whether printer is on-line. * PC-9800's old style port have only BUSY# as status input,
@@ -284,22 +276,22 @@* `PC-9801 Super Technique', Ascii, 1992. */ int count; -unsigned long eflags; +unsigned long flags; -save_flags (eflags); -cli ();/* interrupts while check is fairly bad */ +/* interrupts while check is fairly bad */ +spin_lock_irqsave (&lp_old98_lock, flags);if (!lp_old98_char (DC1 )) { -restore_flags (eflags); +spin_unlock_irqrestore (&lp_old98_lock, flags);return -EBUSY ; } count = (unsigned int )dc1_check >10000 ?10000 : dc1_check; -while (inb (LP_PORT_STATUS ) & LP_MASK_nBUSY ) -if ( --count ==0 ) { -restore_flags (eflags); +while (inb (LP_PORT_STATUS ) & LP_MASK_nBUSY) +if (--count ==0 ) { +spin_unlock_irqrestore (&lp_old98_lock, flags);return -ENODEV ; } -restore_flags (eflags); +spin_unlock_irqrestore (&lp_old98_lock, flags); } lp.flags |=LP_BUSY ;
@@ -329,14 +321,14 @@ {unsigned char data; -if ( (data =inb (LP_PORT_EXTMODE )) !=0xFF && (data &0x10 ) ) { +if ((data =inb (LP_PORT_EXTMODE )) !=0xFF && (data &0x10 )) {printk (KERN_INFO "lp_old98: shutting down extended parallel port mode...\n" );outb (data & ~0x10 ,LP_PORT_EXTMODE ); }#ifdef PC98_HW_H98 -if ( (pc98_hw_flags &PC98_HW_H98 ) - && ((data =inb (LP_PORT_H98MODE )) &0x01 ) ) { +if ((pc98_hw_flags &PC98_HW_H98 ) + && ((data =inb (LP_PORT_H98MODE )) &0x01 )) {printk (KERN_INFO "lp_old98: shutting down H98 full centronics mode...\n" );outb (data & ~0x01 ,LP_PORT_H98MODE );
@@ -358,7 +350,7 @@ {int retval =0 ; -switch ( command ) { +switch (command) {case LPTIME : lp.time = arg *HZ /100 ;break ;
@@ -366,13 +358,13 @@ lp.chars = arg;break ;case LPABORT : -if ( arg ) +if (arg) lp.flags |=LP_ABORT ;else lp.flags &= ~LP_ABORT ;break ;case LPABORTOPEN : -if ( arg ) +if (arg) lp.flags |=LP_ABORTOPEN ;else lp.flags &= ~LP_ABORTOPEN ;
@@ -402,8 +394,8 @@break ;#ifdef LP_STATS case LPGETSTATS : -if (copy_to_user ((struct lp_stats *)arg, &lp.stats, -sizeof (struct lp_stats )) ) +if (copy_to_user ((struct lp_stats *)arg, &lp.stats, +sizeof (struct lp_stats ))) retval = -EFAULT ;else if (suser ())memset (&lp.stats,0 ,sizeof (struct lp_stats ));
@@ -420,13 +412,13 @@ }static struct file_operations lp_old98_fops = { - owner:THIS_MODULE , - llseek: lp_old98_llseek, - read:NULL , - write: lp_old98_write, - ioctl: lp_old98_ioctl, - open: lp_old98_open, - release:lp_old98_release, + .owner =THIS_MODULE , + .llseek = lp_old98_llseek, + .read =NULL , + .write = lp_old98_write, + .ioctl = lp_old98_ioctl, + .open = lp_old98_open, + .release = lp_old98_release, };/*
@@ -494,15 +486,15 @@static kdev_t lp_old98_console_device (struct console *console) { -return MKDEV (LP_MAJOR ,0 ); +return mk_kdev (LP_MAJOR ,0 ); }static struct console lp_old98_console = { - name:"lp_old98" , - write: lp_old98_console_write, - device: lp_old98_console_device, - flags:CON_PRINTBUFFER , - index:-1 , + .name ="lp_old98" , + .write = lp_old98_console_write, + .device = lp_old98_console_device, + .flags =CON_PRINTBUFFER , + .index =-1 , };#endif /* console on lp_old98 */
@@ -544,7 +536,7 @@* but for locking out other printer drivers... */ #ifdef PC98_HW_H98 -if ( pc98_hw_flags &PC98_HW_H98 ) +if (pc98_hw_flags &PC98_HW_H98 )request_region (LP_PORT_H98MODE ,1 ,"lp_old98" );#endif request_region (LP_PORT_EXTMODE ,1 ,"lp_old98" );
@@ -565,7 +557,7 @@release_region (LP_PORT_STATUS ,1 );release_region (LP_PORT_STROBE ,1 );#ifdef PC98_HW_H98 -if ( pc98_hw_flags &PC98_HW_H98 ) +if (pc98_hw_flags &PC98_HW_H98 )release_region (LP_PORT_H98MODE ,1 );#endif release_region (LP_PORT_EXTMODE ,1 );
@@ -573,5 +565,7 @@MODULE_PARM (dc1_check,"1i" );MODULE_AUTHOR ("Kousuke Takai <[email protected]>" ); +MODULE_DESCRIPTION ("PC-9800 old printer port driver" ); +MODULE_LICENSE ("GPL" );#endif
PATCH 1/1 PC-9800 addtional for 2.5.50-ac1 (4/21)
In reply to Osamu TomitaNEC PC-9800 subarchitecture support patch for 2.5.50-ac1 (4/21) This is updates for mach-pc9800/setup.c.
"APM bios version bug fix" moved here from apm.c.
diffstat:
arch/i386/mach-pc9800/setup.c | 6 ++++++ 1 files changed, 6 insertions(+)
Regards,
Osamu Tomita
arch/i386/mach-pc9800/setup.c +6 -0
@@ -8,6 +8,7 @@#include <linux/init.h> #include <linux/irq.h> #include <linux/interrupt.h> +#include <linux/apm_bios.h> #include <asm/setup.h> #include <asm/arch_hooks.h>
@@ -69,6 +70,11 @@SYS_DESC_TABLE .length =0 ; MCA_bus =0 ; pc98 =1 ; +#ifdef CONFIG_PC9800 +/* In PC-9800, APM BIOS version is written in BCD...?? */ +APM_BIOS_INFO .version = (APM_BIOS_INFO .version &0xff00 ) + | ((APM_BIOS_INFO .version &0x00f0 ) >>4 ); +#endif }/**
PATCH 1/1 PC-9800 addtional for 2.5.50-ac1 (5/21)
In reply to Osamu TomitaNEC PC-9800 subarchitecture support patch for 2.5.50-ac1(5/21) This is updates for drivers/pci/quirks.c.
Add entry for PCI to C-Bus bridge Rev.2 and Rev.3.
diffstat:
drivers/pci/quirks.c | 2 ++ 1 files changed, 2 insertions(+)
Regards,
Osamu Tomita
drivers/pci/quirks.c renamed from drivers/pci/quirks.c.orig +2 -0
@@ -530,6 +530,8 @@ { PCI_FIXUP_FINAL, PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C596, quirk_isa_dma_hangs }, { PCI_FIXUP_FINAL, PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371SB_0, quirk_isa_dma_hangs }, { PCI_FIXUP_FINAL, PCI_VENDOR_ID_NEC, PCI_DEVICE_ID_NEC_CBUS_1, quirk_isa_dma_hangs }, + { PCI_FIXUP_FINAL, PCI_VENDOR_ID_NEC, PCI_DEVICE_ID_NEC_CBUS_2, quirk_isa_dma_hangs }, + { PCI_FIXUP_FINAL, PCI_VENDOR_ID_NEC, PCI_DEVICE_ID_NEC_CBUS_3, quirk_isa_dma_hangs }, { PCI_FIXUP_HEADER, PCI_VENDOR_ID_S3, PCI_DEVICE_ID_S3_868, quirk_s3_64M }, { PCI_FIXUP_HEADER, PCI_VENDOR_ID_S3, PCI_DEVICE_ID_S3_968, quirk_s3_64M }, { PCI_FIXUP_FINAL, PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82437, quirk_triton },
PATCH 1/1 PC-9800 addtional for 2.5.50-ac1 (6/21)
In reply to Osamu TomitaNEC PC-9800 subarchitecture support patch for 2.5.50-ac1 (6/21) This is APM support patch.
Split "BIOS version bug fix" into mach-pc9800/setup.c. SMP Fix for ASUS A7M266D works good for PC-9800 too. So I can remove many #ifdefs. Thanks!
diffstat:
arch/i386/kernel/apm.c | 18 ++++++++++++++---- include/linux/apm_bios.h | 24 ++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 4 deletions(-)
Regards,
Osamu Tomita
arch/i386/kernel/apm.c +14 -4
@@ -227,6 +227,10 @@#include <linux/sysrq.h> +#include "io_ports.h" + +extern int pc98;/* Indicates PC-9800 architecture No:0 Yes:1 */ +extern rwlock_t xtime_lock;extern spinlock_t i8253_lock;extern unsigned long get_cmos_time (void );
@@ -629,6 +633,9 @@ __asm__ __volatile__(APM_DO_ZERO_SEGS "pushl %%edi\n\t" "pushl %%ebp\n\t" +#ifdef CONFIG_PC9800 + "pushfl\n\t" +#endif"lcall *%%cs:apm_bios_entry\n\t" "setc %%al\n\t" "popl %%ebp\n\t"
@@ -690,6 +697,9 @@ __asm__ __volatile__(APM_DO_ZERO_SEGS "pushl %%edi\n\t" "pushl %%ebp\n\t" +#ifdef CONFIG_PC9800 + "pushfl\n\t" +#endif"lcall *%%cs:apm_bios_entry\n\t" "setc %%bl\n\t" "popl %%ebp\n\t"
@@ -730,7 +740,7 @@if (apm_bios_call_simple (APM_FUNC_VERSION ,0 , *val, &eax))return (eax >>8 ) &0xff ; - *val = eax; + *val = pc98 ? ((eax &0xff00 ) | ((eax &0x00f0 ) >>4 )) : eax;return APM_SUCCESS ; }
@@ -1243,11 +1253,11 @@ {#ifdef INIT_TIMER_AFTER_SUSPEND /* set the clock to 100 Hz */ -outb_p (0x34 ,0x43 );/* binary, mode 2, LSB/MSB, ch 0 */ +outb_p (0x34 ,PIT_MODE );/* binary, mode 2, LSB/MSB, ch 0 */ udelay (10 ); -outb_p (LATCH &0xff ,0x40 );/* LSB */ +outb_p (LATCH &0xff ,PIT_CH0 );/* LSB */ udelay (10 ); -outb (LATCH >>8 ,0x40 );/* MSB */ +outb (LATCH >>8 ,PIT_CH0 );/* MSB */ udelay (10 );#endif }
include/linux/apm_bios.h +24 -0
@@ -20,6 +20,7 @@typedef unsigned short apm_eventinfo_t ;#ifdef __KERNEL__ +#include <linux/config.h> #define APM_CS (GDT_ENTRY_APMBIOS_BASE * 8)#define APM_CS_16 (APM_CS + 8)
@@ -60,6 +61,7 @@/* * The APM function codes */ +#ifndef CONFIG_PC9800 #define APM_FUNC_INST_CHECK 0x5300#define APM_FUNC_REAL_CONN 0x5301#define APM_FUNC_16BIT_CONN 0x5302
@@ -80,6 +82,28 @@#define APM_FUNC_RESUME_TIMER 0x5311#define APM_FUNC_RESUME_ON_RING 0x5312#define APM_FUNC_TIMER 0x5313 +#else +#define APM_FUNC_INST_CHECK 0x9a00 +#define APM_FUNC_REAL_CONN 0x9a01 +#define APM_FUNC_16BIT_CONN 0x9a02 +#define APM_FUNC_32BIT_CONN 0x9a03 +#define APM_FUNC_DISCONN 0x9a04 +#define APM_FUNC_IDLE 0x9a05 +#define APM_FUNC_BUSY 0x9a06 +#define APM_FUNC_SET_STATE 0x9a07 +#define APM_FUNC_ENABLE_PM 0x9a08 +#define APM_FUNC_RESTORE_BIOS 0x9a09 +#define APM_FUNC_GET_STATUS 0x9a3a +#define APM_FUNC_GET_EVENT 0x9a0b +#define APM_FUNC_GET_STATE 0x9a0c +#define APM_FUNC_ENABLE_DEV_PM 0x9a0d +#define APM_FUNC_VERSION 0x9a3e +#define APM_FUNC_ENGAGE_PM 0x9a3f +#define APM_FUNC_GET_CAP 0x9a10 +#define APM_FUNC_RESUME_TIMER 0x9a11 +#define APM_FUNC_RESUME_ON_RING 0x9a12 +#define APM_FUNC_TIMER 0x9a13 +#endif /* * Function code for APM_FUNC_RESUME_TIMER
PATCH 1/1 PC-9800 addtional for 2.5.50-ac1 (7/21)
In reply to Osamu TomitaNEC PC-9800 subarchitecture support patch for 2.5.50-ac1 (7/21) This patch contains changes under arch/i386/*.
diffstat:
arch/i386/Kconfig | 25 +++- arch/i386/Makefile | 15 ++ arch/i386/kernel/setup.c | 99 ---------------- arch/i386/kernel/time.c | 115 ++----------------- arch/i386/kernel/timers/timer_pit.c | 22 ++- arch/i386/kernel/timers/timer_tsc.c | 94 ++------------- arch/i386/kernel/traps.c | 12 -- arch/i386/mach-generic/calibrate_tsc.h | 90 +++++++++++++++ arch/i386/mach-generic/mach_resources.h | 113 ++++++++++++++++++ arch/i386/mach-generic/mach_time.h | 122 ++++++++++++++++++++ arch/i386/mach-generic/mach_traps.h | 29 ++++ arch/i386/mach-pc9800/calibrate_tsc.h | 71 +++++++++++ arch/i386/mach-pc9800/do_timer.h | 82 +++++++++++++ arch/i386/mach-pc9800/mach_resources.h | 192 ++++++++++++++++++++++++++++++++ arch/i386/mach-pc9800/mach_time.h | 136 ++++++++++++++++++++++ arch/i386/mach-pc9800/mach_traps.h | 27 ++++ arch/i386/mach-pc9800/smpboot_hooks.h | 33 +++++ arch/i386/mach-summit/calibrate_tsc.h | 1 arch/i386/mach-summit/mach_resources.h | 1 arch/i386/mach-summit/mach_time.h | 1 arch/i386/mach-summit/mach_traps.h | 1 arch/i386/mach-visws/calibrate_tsc.h | 1 arch/i386/mach-visws/mach_resources.h | 1 arch/i386/mach-visws/mach_time.h | 1 arch/i386/mach-visws/mach_traps.h | 1 arch/i386/mach-voyager/calibrate_tsc.h | 1 arch/i386/mach-voyager/mach_resources.h | 1 arch/i386/mach-voyager/mach_time.h | 1 arch/i386/mach-voyager/mach_traps.h | 1 29 files changed, 996 insertions(+), 293 deletions(-)
Regards,
Osamu Tomita
arch/i386/Kconfig +22 -3
@@ -353,6 +353,12 @@ If you do not specifically know you have a Voyager based machine, say N here otherwise the kernel you build will not be bootable. +config PC9800 + bool "NEC PC-9800 Architecture" + help + To make kernel for NEC PC-9801/PC-9821 architecture, say Y. + If say Y, kernel works -ONLY- on PC-9800 architecture. + config X86_UP_APIC bool "Local APIC support on uniprocessors" if !SMP
@@ -1123,7 +1129,7 @@ config EISA bool "EISA support" - depends on ISA + depends on ISA && !PC9800 ---help--- The Extended Industry Standard Architecture (EISA) bus was developed as an open alternative to the IBM MicroChannel bus.
@@ -1139,7 +1145,7 @@ config MCA bool "MCA support" if !VOYAGER - depends on !VISWS + depends on !(VISWS || PC9800) default y if VOYAGER help MicroChannel Architecture is found in some IBM PS/2 machines and
@@ -1488,6 +1494,7 @@ config VGA_CONSOLE bool "VGA text console" + depends on !PC9800 help Saying Y here will allow you to use Linux in text mode through a display that complies with the generic VGA standard. Virtually
@@ -1501,7 +1508,7 @@ config VIDEO_SELECT bool "Video mode selection support" - depends on !VISWS + depends on !(VISWS || PC9800) ---help--- This enables support for text mode selection on kernel startup. If you want to take advantage of some high-resolution text mode your
@@ -1515,6 +1522,18 @@ Read the file <file:Documentation/svga.txt> for more information about the Video mode selection support. If unsure, say N. +config GDC_CONSOLE + bool "PC-9800 GDC text console" + depends on PC9800 + default y + help + This enables support for PC-9800 standard text mode console. + If use PC-9801/PC-9821, Say Y. + +config GDC_32BITACCESS + bool "Enable 32-bit access to text video RAM" + depends on GDC_CONSOLE + if EXPERIMENTAL config MDA_CONSOLE
arch/i386/Makefile +12 -3
@@ -52,9 +52,13 @@ ifdef CONFIG_VOYAGER MACHINE := mach-voyager else +ifdef CONFIG_PC9800 +MACHINE := mach-pc9800 +else MACHINE := mach-generic endif endif +endif ifdef CONFIG_X86_STACK_CHECK CFLAGS += -p
@@ -74,15 +78,20 @@ CFLAGS += -Iarch/i386/$(MACHINE) -Iarch/i386/mach-defaults AFLAGS += -Iarch/i386/$(MACHINE) -Iarch/i386/mach-defaults -makeboot = $(call descend,arch/i386/boot,$(1)) +ifndef CONFIG_PC9800 +ARCHDIR=arch/i386/boot +else +ARCHDIR=arch/i386/boot98 +endif +makeboot = $(call descend,$(ARCHDIR),$(1)) .PHONY: zImage bzImage compressed zlilo bzlilo zdisk bzdisk install \ clean archclean archmrproper all: bzImage -BOOTIMAGE=arch/i386/boot/bzImage -zImage zlilo zdisk: BOOTIMAGE=arch/i386/boot/zImage +BOOTIMAGE=$(ARCHDIR)/bzImage +zImage zlilo zdisk: BOOTIMAGE=$(ARCHDIR)/zImage zImage bzImage: vmlinux +@$(call makeboot,$(BOOTIMAGE))
arch/i386/kernel/setup.c +5 -94
132 lines not on this page · raw message
arch/i386/kernel/time.c +17 -98
164 lines not on this page · raw message
arch/i386/kernel/timers/timer_pit.c +15 -7
@@ -16,6 +16,7 @@extern spinlock_t i8259A_lock;extern spinlock_t i8253_lock;#include "do_timer.h" +#include "io_ports.h" static int init_pit (void ) {
@@ -64,7 +65,8 @@ {int count; -static int count_p =LATCH ;/* for the first call after boot */ +static int count_p; +static int is_1st_boot =1 ;/* for the first call after boot */ static unsigned long jiffies_p =0 ;/*
@@ -72,12 +74,18 @@*/ unsigned long jiffies_t; +/* for support LATCH is not constant */ +if (is_1st_boot) { + is_1st_boot =0 ; + count_p =LATCH ; + } +/* gets recalled with irq locally disabled */ spin_lock (&i8253_lock);/* timer count may underflow right here */ -outb_p (0x00 ,0x43 );/* latch the count ASAP */ +outb_p (0x00 ,PIT_MODE );/* latch the count ASAP */ - count =inb_p (0x40 );/* read the latched count */ + count =inb_p (PIT_CH0 );/* read the latched count */ /* * We do this guaranteed double memory access instead of a _p
@@ -85,13 +93,13 @@*/ jiffies_t = jiffies; - count |=inb_p (0x40 ) <<8 ; + count |=inb_p (PIT_CH0 ) <<8 ;/* VIA686a test code... reset the latch if count > max + 1 */ if (count >LATCH ) { -outb_p (0x34 ,0x43 ); -outb_p (LATCH &0xff ,0x40 ); -outb (LATCH >>8 ,0x40 ); +outb_p (0x34 ,PIT_MODE ); +outb_p (LATCH &0xff ,PIT_CH0 ); +outb (LATCH >>8 ,PIT_CH0 ); count =LATCH -1 ; }
arch/i386/kernel/timers/timer_tsc.c +13 -81
127 lines not on this page · raw message
arch/i386/kernel/traps.c +5 -7
@@ -50,6 +50,8 @@#include <linux/irq.h> #include <linux/module.h> +#include "mach_traps.h" + asmlinkage int system_call(void); asmlinkage void lcall7(void); asmlinkage void lcall27(void);
@@ -457,8 +459,7 @@printk ("You probably have a hardware problem with your RAM chips\n" );/* Clear and disable the memory parity error line. */ - reason = (reason &0xf ) |4 ; -outb (reason,0x61 ); +clear_mem_error (reason); }static void io_check_error (unsigned char reason,struct pt_regs * regs)
@@ -495,7 +496,7 @@static void default_do_nmi (struct pt_regs * regs) { -unsigned char reason =inb (0x61 ); +unsigned char reason =get_nmi_reason ();if (!(reason &0xc0 )) {#if CONFIG_X86_LOCAL_APIC
@@ -519,10 +520,7 @@* Reassert NMI in case it became active meanwhile * as it's edge-triggered. */ -outb (0x8f ,0x70 ); -inb (0x71 );/* dummy */ -outb (0x0f ,0x70 ); -inb (0x71 );/* dummy */ +reassert_nmi (); }static int dummy_nmi_callback (struct pt_regs * regs,int cpu)
arch/i386/mach-generic/calibrate_tsc.h +90 -0
90 lines not on this page · raw message
arch/i386/mach-generic/mach_resources.h +113 -0
113 lines not on this page · raw message
arch/i386/mach-generic/mach_time.h +122 -0
122 lines not on this page · raw message
arch/i386/mach-generic/mach_traps.h +29 -0
@@ -0,0 +1,29 @@ +/* +* arch/i386/mach-generic/mach_traps.h +* +* Machine specific NMI handling for generic. +* Split out from traps.c by Osamu Tomita <[email protected]> +*/ +#ifndef _MACH_TRAPS_H +#define _MACH_TRAPS_H + +static inline void clear_mem_error (unsigned char reason) +{ + reason = (reason &0xf ) |4 ; +outb (reason,0x61 ); +} + +static inline unsigned char get_nmi_reason (void ) +{ +return inb (0x61 ); +} + +static inline void reassert_nmi (void ) +{ +outb (0x8f ,0x70 ); +inb (0x71 );/* dummy */ +outb (0x0f ,0x70 ); +inb (0x71 );/* dummy */ +} + +#endif /* !_MACH_TRAPS_H */
arch/i386/mach-pc9800/calibrate_tsc.h +71 -0
71 lines not on this page · raw message
arch/i386/mach-pc9800/do_timer.h +82 -0
82 lines not on this page · raw message
arch/i386/mach-pc9800/mach_resources.h +192 -0
192 lines not on this page · raw message
arch/i386/mach-pc9800/mach_time.h +136 -0
136 lines not on this page · raw message
arch/i386/mach-pc9800/mach_traps.h +27 -0
@@ -0,0 +1,27 @@ +/* +* arch/i386/mach-pc9800/mach_traps.h +* +* Machine specific NMI handling for PC-9800. +* Written by Osamu Tomita <[email protected]> +*/ +#ifndef _MACH_TRAPS_H +#define _MACH_TRAPS_H + +static inline void clear_mem_error (unsigned char reason) +{ +outb (0x08 ,0x37 ); +outb (0x09 ,0x37 ); +} + +static inline unsigned char get_nmi_reason (void ) +{ +return (inb (0x33 ) &6 ) ?0x80 :0 ; +} + +static inline void reassert_nmi (void ) +{ +outb (0x09 ,0x50 );/* disable NMI once */ +outb (0x09 ,0x52 );/* re-enable it */ +} + +#endif /* !_MACH_TRAPS_H */
arch/i386/mach-pc9800/smpboot_hooks.h +33 -0
@@ -0,0 +1,33 @@ +/* two abstractions specific to kernel/smpboot.c, mainly to cater to visws +* which needs to alter them. */ + +static inline void smpboot_clear_io_apic_irqs (void ) +{ + io_apic_irqs =0 ; +} + +static inline void smpboot_setup_warm_reset_vector (void ) +{ +/* +* Install writable page 0 entry to set BIOS data area. +*/ +local_flush_tlb (); + +/* +* Paranoid: Set warm reset code and vector here back +* to default values. +*/ +outb (0x0f ,0x37 );/* SHUT0 = 1 */ + + *((volatile long *)phys_to_virt (0x404 )) =0 ; +} + +static inline void smpboot_setup_io_apic (void ) +{ +/* +* Here we can be sure that there is an IO-APIC in the system. Let's +* go and set it up: +*/ +if (!skip_ioapic_setup && nr_ioapics) +setup_IO_APIC (); +}
arch/i386/mach-summit/calibrate_tsc.h +1 -0
@@ -0,0 +1 @@ +#include "../mach-generic/calibrate_tsc.h"
arch/i386/mach-summit/mach_resources.h +1 -0
@@ -0,0 +1 @@ +#include "../mach-generic/mach_resources.h"
arch/i386/mach-summit/mach_time.h +1 -0
@@ -0,0 +1 @@ +#include "../mach-generic/mach_time.h"
arch/i386/mach-summit/mach_traps.h +1 -0
@@ -0,0 +1 @@ +#include "../mach-generic/mach_traps.h"
arch/i386/mach-visws/calibrate_tsc.h +1 -0
@@ -0,0 +1 @@ +#include "../mach-generic/calibrate_tsc.h"
arch/i386/mach-visws/mach_resources.h +1 -0
@@ -0,0 +1 @@ +#include "../mach-generic/mach_resources.h"
arch/i386/mach-visws/mach_time.h +1 -0
@@ -0,0 +1 @@ +#include "../mach-generic/mach_time.h"
arch/i386/mach-visws/mach_traps.h +1 -0
@@ -0,0 +1 @@ +#include "../mach-generic/mach_traps.h"
arch/i386/mach-voyager/calibrate_tsc.h +1 -0
@@ -0,0 +1 @@ +#include "../mach-generic/calibrate_tsc.h"
arch/i386/mach-voyager/mach_resources.h +1 -0
@@ -0,0 +1 @@ +#include "../mach-generic/mach_resources.h"
arch/i386/mach-voyager/mach_time.h +1 -0
@@ -0,0 +1 @@ +#include "../mach-generic/mach_time.h"
arch/i386/mach-voyager/mach_traps.h +1 -0
@@ -0,0 +1 @@ +#include "../mach-generic/mach_traps.h"
PATCH 1/1 PC-9800 addtional for 2.5.50-ac1 (8/21)
In reply to Osamu TomitaNEC PC-9800 subarchitecture support patch for 2.5.50-ac1 (8/21) This is VT console support patch.
I separate namings "#ifdef CONFIG_KANJI" for 2bytes character support from "#ifdef CONFIG_PC9800".
diffstat:
drivers/char/Makefile | 9 drivers/char/console_macros.h | 14 + drivers/char/console_pc9800.h | 14 + drivers/char/consolemap.c | 58 ++++- drivers/char/pc9800.uni | 260 ++++++++++++++++++++++ drivers/char/vt.c | 464 +++++++++++++++++++++++++++++++++++------ drivers/char/vt_ioctl.c | 19 + include/linux/console.h | 11 include/linux/console_struct.h | 25 ++ include/linux/consolemap.h | 1 include/linux/tty.h | 4 include/linux/vt.h | 1 include/linux/vt_buffer.h | 4 13 files changed, 814 insertions(+), 70 deletions(-)
Regards,
Osamu Tomita
drivers/char/Makefile +8 -1
@@ -5,7 +5,11 @@ # # This file contains the font map for the default (hardware) font # +ifneq ($(CONFIG_PC9800),y) FONTMAPFILE = cp437.uni +else +FONTMAPFILE = pc9800.uni +endif obj-y += mem.o tty_io.o n_tty.o tty_ioctl.o pty.o misc.o random.o
@@ -14,7 +18,8 @@ export-objs := busmouse.o vt.o generic_serial.o ip2main.o \ ite_gpio.o keyboard.o misc.o nvram.o random.o rtc.o \ - selection.o sonypi.o sysrq.o tty_io.o tty_ioctl.o + selection.o sonypi.o sysrq.o tty_io.o tty_ioctl.o \ + upd4990a.o obj-$(CONFIG_VT) += vt_ioctl.o vc_screen.o consolemap.o consolemap_deftbl.o selection.o keyboard.o obj-$(CONFIG_HW_CONSOLE) += vt.o defkeymap.o
@@ -51,6 +56,7 @@ obj-$(CONFIG_PRINTER) += lp.o obj-$(CONFIG_TIPAR) += tipar.o +obj-$(CONFIG_PC9800_OLDLP) += lp_old98.o obj-$(CONFIG_BUSMOUSE) += busmouse.o obj-$(CONFIG_DTLK) += dtlk.o
@@ -58,6 +64,7 @@ obj-$(CONFIG_APPLICOM) += applicom.o obj-$(CONFIG_SONYPI) += sonypi.o obj-$(CONFIG_RTC) += rtc.o +obj-$(CONFIG_RTC98) += upd4990a.o obj-$(CONFIG_GEN_RTC) += genrtc.o obj-$(CONFIG_EFI_RTC) += efirtc.o ifeq ($(CONFIG_PPC),)
drivers/char/console_macros.h +14 -0
@@ -55,6 +55,10 @@#define s_reverse (vc_cons[currcons].d->vc_s_reverse)#define ulcolor (vc_cons[currcons].d->vc_ulcolor)#define halfcolor (vc_cons[currcons].d->vc_halfcolor) +#define def_attr (vc_cons[currcons].d->vc_def_attr) +#define ul_attr (vc_cons[currcons].d->vc_ul_attr) +#define half_attr (vc_cons[currcons].d->vc_half_attr) +#define bold_attr (vc_cons[currcons].d->vc_bold_attr)#define tab_stop (vc_cons[currcons].d->vc_tab_stop)#define palette (vc_cons[currcons].d->vc_palette)#define bell_pitch (vc_cons[currcons].d->vc_bell_pitch)
@@ -64,6 +68,16 @@#define complement_mask (vc_cons[currcons].d->vc_complement_mask)#define s_complement_mask (vc_cons[currcons].d->vc_s_complement_mask)#define hi_font_mask (vc_cons[currcons].d->vc_hi_font_mask) +#define kanji_mode (vc_cons[currcons].d->vc_kanji_mode) +#define s_kanji_mode (vc_cons[currcons].d->vc_s_kanji_mode) +#define kanji_char1 (vc_cons[currcons].d->vc_kanji_char1) +#define translate_ex (vc_cons[currcons].d->vc_translate_ex) +#define G0_charset_ex (vc_cons[currcons].d->vc_G0_charset_ex) +#define G1_charset_ex (vc_cons[currcons].d->vc_G1_charset_ex) +#define saved_G0_ex (vc_cons[currcons].d->vc_saved_G0_ex) +#define saved_G1_ex (vc_cons[currcons].d->vc_saved_G1_ex) +#define kanji_jis_mode (vc_cons[currcons].d->vc_kanji_jis_mode) +#define s_kanji_jis_mode (vc_cons[currcons].d->vc_s_kanji_jis_mode)#define vcmode (vt_cons[currcons]->vc_mode)
drivers/char/console_pc9800.h +14 -0
@@ -0,0 +1,14 @@ +#ifndef __CONSOLE_PC9800_H +#define __CONSOLE_PC9800_H + +#define BLANK_ATTR 0x00E1 + +#define JIS_CODE 0x01 +#define EUC_CODE 0x00 +#define SJIS_CODE 0x02 +#define JIS_CODE_ASCII 0x00 +#define JIS_CODE_78 0x01 +#define JIS_CODE_83 0x02 +#define JIS_CODE_90 0x03 + +#endif /* __CONSOLE_PC9800_H */
drivers/char/consolemap.c +55 -3
76 lines not on this page · raw message
drivers/char/pc9800.uni +260 -0
260 lines not on this page · raw message
drivers/char/vt.c +400 -64
719 lines not on this page · raw message
drivers/char/vt_ioctl.c +19 -0
@@ -63,9 +63,11 @@asmlinkage long sys_ioperm (unsigned long from,unsigned long num,int on);#endif +#ifndef CONFIG_PC9800 unsigned int video_font_height;unsigned int default_font_height;unsigned int video_scan_lines; +#endif /* * these are the valid i/o ports we're allowed to change. they map all the
@@ -637,6 +639,17 @@return 0 ; } +#ifdef CONFIG_PC9800 +case VT_GDC_RESIZE : + { +if (!perm) +return -EPERM ; +/* con_adjust_height(0);*/ +update_screen (console); +return 0 ; + } +#endif +case VT_SETMODE : {struct vt_mode tmp;
@@ -828,7 +841,9 @@__get_user (clin, &vtconsize->v_clin);__get_user (vcol, &vtconsize->v_vcol);__get_user (ccol, &vtconsize->v_ccol); +#ifndef CONFIG_PC9800 vlin = vlin ? vlin : video_scan_lines; +#endif if ( clin ) {if ( ll )
@@ -853,10 +868,12 @@if ( clin >32 )return -EINVAL ; +#ifndef CONFIG_PC9800 if ( vlin ) video_scan_lines = vlin;if ( clin ) video_font_height = clin; +#endif return vc_resize_all (ll, cc); }
@@ -1024,8 +1041,10 @@ vt_cons[new_console]->vt_mode.frsig =0 ; vt_cons[new_console]->vt_pid =-1 ; vt_cons[new_console]->vt_newvt =-1 ; +#ifndef CONFIG_PC9800 if (!in_interrupt ())/* Via keyboard.c:SAK() - akpm */ reset_palette (new_console) ; +#endif }/*
include/linux/console.h +10 -1
@@ -17,6 +17,13 @@#include <linux/types.h> #include <linux/kdev_t.h> #include <linux/spinlock.h> +#include <linux/config.h> + +#ifndef CONFIG_PC9800 +typedef __u16 vram_char_t ; +#else +typedef __u32 vram_char_t ; +#endif struct vc_data ;struct console_font_op ;
@@ -32,7 +39,7 @@void (*con_init)(struct vc_data *,int );void (*con_deinit)(struct vc_data *);void (*con_clear)(struct vc_data *,int ,int ,int ,int ); -void (*con_putc)(struct vc_data *,int ,int ,int ); +void (*con_putc)(struct vc_data *,int ,vram_char_t ,int );void (*con_putcs)(struct vc_data *,const unsigned short *,int ,int ,int );void (*con_cursor)(struct vc_data *,int );int (*con_scroll)(struct vc_data *,int ,int ,int ,int );
@@ -48,6 +55,7 @@void (*con_invert_region)(struct vc_data *,u16 *,int );u16 *(*con_screen_pos)(struct vc_data *,int );unsigned long (*con_getxy)(struct vc_data *,unsigned long ,int *,int *); +int (*con_setterm_command)(struct vc_data *); };extern const struct consw *conswitchp;
@@ -55,6 +63,7 @@extern const struct consw dummy_con;/* dummy console buffer */ extern const struct consw fb_con;/* frame buffer based console */ extern const struct consw vga_con;/* VGA text console */ +extern const struct consw gdc_con;/* PC-9800 GDC text console */ extern const struct consw newport_con;/* SGI Newport console */ extern const struct consw prom_con;/* SPARC PROM console */
include/linux/console_struct.h +24 -1
@@ -9,6 +9,9 @@* to achieve effects such as fast scrolling by changing the origin. */ +#include <linux/config.h> +#include <linux/console.h> +#define NPAR 16struct vc_data {
@@ -25,9 +28,13 @@unsigned char vc_s_color;/* Saved foreground & background */ unsigned char vc_ulcolor;/* Color for underline mode */ unsigned char vc_halfcolor;/* Color for half intensity mode */ +unsigned char vc_def_attr;/* Default attributes */ +unsigned char vc_ul_attr;/* Attribute for underline mode */ +unsigned char vc_half_attr;/* Attribute for half intensity mode */ +unsigned char vc_bold_attr;/* Attribute for bold mode */ unsigned short vc_complement_mask;/* [#] Xor mask for mouse pointer */ unsigned short vc_hi_font_mask;/* [#] Attribute set for upper 256 chars of font or 0 if not supported */ -unsigned short vc_video_erase_char;/* Background erase character */ +vram_char_t vc_video_erase_char;/* Background erase character */ unsigned short vc_s_complement_mask;/* Saved mouse pointer mask */ unsigned int vc_x, vc_y;/* Cursor position */ unsigned int vc_top, vc_bottom;/* Scrolling region */
@@ -82,6 +89,18 @@struct vc_data **vc_display_fg;/* [!] Ptr to var holding fg console for this display */ unsigned long vc_uni_pagedir;unsigned long *vc_uni_pagedir_loc;/* [!] Location of uni_pagedir variable for this console */ +#ifdef CONFIG_KANJI +unsigned char vc_kanji_char1; +unsigned char vc_kanji_mode; +unsigned char vc_kanji_jis_mode; +unsigned char vc_s_kanji_mode; +unsigned char vc_s_kanji_jis_mode; +unsigned int vc_translate_ex; +unsigned char vc_G0_charset_ex; +unsigned char vc_G1_charset_ex; +unsigned char vc_saved_G0_ex; +unsigned char vc_saved_G1_ex; +#endif /* CONFIG_KANJI */ /* additional information is in vt_kern.h */ };
@@ -105,6 +124,10 @@#define CUR_HWMASK 0x0f#define CUR_SWMASK 0xfff0 +#ifndef CONFIG_PC9800 #define CUR_DEFAULT CUR_UNDERLINE +#else +#define CUR_DEFAULT CUR_BLOCK +#endif #define CON_IS_VISIBLE (conp) (*conp->vc_display_fg == conp)
include/linux/consolemap.h +1 -0
@@ -7,6 +7,7 @@#define GRAF_MAP 1#define IBMPC_MAP 2#define USER_MAP 3 +#define JP_MAP 4struct vc_data ;
include/linux/tty.h +4 -0
@@ -123,6 +123,10 @@#define VIDEO_TYPE_PMAC 0x60/* PowerMacintosh frame buffer. */ +#define VIDEO_TYPE_98NORMAL 0xa4/* NEC PC-9800 normal */ +#define VIDEO_TYPE_9840 0xa5/* NEC PC-9800 normal 40 lines */ +#define VIDEO_TYPE_98HIRESO 0xa6/* NEC PC-9800 hireso */ +/* * This character is the same as _POSIX_VDISABLE: it cannot be used as * a c_cc[] character, but indicates that a particular special character
include/linux/vt.h +1 -0
@@ -50,5 +50,6 @@#define VT_RESIZEX 0x560A/* set kernel's idea of screensize + more */ #define VT_LOCKSWITCH 0x560B/* disallow vt switching */ #define VT_UNLOCKSWITCH 0x560C/* allow vt switching */ +#define VT_GDC_RESIZE 0x5698#endif /* _LINUX_VT_H */
include/linux/vt_buffer.h +4 -0
@@ -19,6 +19,10 @@#include <asm/vga.h> #endif +#ifdef CONFIG_GDC_CONSOLE +#include <asm/gdc.h> +#endif +#ifndef VT_BUF_HAVE_RW #define scr_writew (val, addr) (*(addr) = (val))#define scr_readw (addr) (*(addr))
PATCH 1/1 PC-9800 addtional for 2.5.50-ac1 (9/21)
In reply to Osamu TomitaNEC PC-9800 subarchitecture support patch for 2.5.50-ac1 (9/21) This is patch for support C-bus (PC98's legacy bus like ISA) network cards.
Changes are small cleanup and bug fix.
diffstat:
drivers/net/8390.h | 3 drivers/net/Kconfig | 55 +++++ drivers/net/Makefile | 1 drivers/net/Makefile.lib | 1 drivers/net/Space.c | 2 drivers/net/3c509.c | 33 +++ drivers/net/at1700.c | 115 +++++++++-- drivers/net/ne.c | 359 +++++++++++++++++++++++++++++++++-- drivers/net/ne2k_cbus.h | 481 +++++++++++++++++++++++++++++++++++++++++++++++ 9 files changed, 1018 insertions(+), 32 deletions(-)
Regards,
Osamu Tomita
drivers/net/3c509.c +33 -0
@@ -54,6 +54,10 @@v1.19a 28Oct2002 Davud Ruggiero <[email protected]> - Increase *read_eeprom udelay to workaround oops with 2 cards. */ +/* +FIXES for PC-9800: +Shu Iwanaga: 3c569B(PC-9801 C-bus) support +*/ #define DRV_NAME "3c509"#define DRV_VERSION "1.19a"
@@ -168,7 +172,11 @@struct pm_dev *pmdev;#endif }; +#ifdef CONFIG_PC9800 +static int id_port__initdata =0x71d0 ; +#else static int id_port__initdata =0x110 ;/* Start with 0x110 to avoid new sound cards.*/ +#endif static struct net_device *el3_root_dev;static ushort id_read_eeprom (int index);
@@ -389,6 +397,7 @@ no_pnp:#endif /* __ISAPNP__ */ +#ifndef CONFIG_PC9800 /* Error for NEC C-bus */ /* Select an open I/O location at 0x1*0 to do contention select. */ for ( ; id_port <0x200 ; id_port +=0x10 ) {if (check_region (id_port,1 ))
@@ -403,6 +412,7 @@printk (" WARNING: No I/O port available for 3c509 activation.\n" ); return -ENODEV; } +#endif /* CONFIG_PC9800 */ /* Next check for all ISA bus boards by sending the ID sequence to the ID_PORT. We find cards past the first by setting the 'current_tag' on cards as they are found. Cards with their tag set will not
@@ -458,7 +468,11 @@ {unsigned int iobase =id_read_eeprom (8 ); if_port = iobase >>14 ; +#ifndef CONFIG_PC9800 ioaddr =0x200 + ((iobase &0x1f ) <<4 ); +#else + ioaddr =0x40d0 + ((iobase &0x1f ) <<8 ); +#endif } irq =id_read_eeprom (9 ) >>12 ;
@@ -482,7 +496,15 @@outb (0xd0 + ++current_tag, id_port);/* Activate the adaptor at the EEPROM location. */ +#ifndef CONFIG_PC9800 outb ((ioaddr >>4 ) |0xe0 , id_port); +#else +outb ((ioaddr >>8 ) |0xe0 , id_port); +if (irq ==7 ) + irq =6 ; +else if (irq ==15 ) + irq =13 ; +#endif EL3WINDOW (0 );if (inw (ioaddr) !=0x6d50 ) {
@@ -1255,7 +1277,18 @@outw (0x0001 , ioaddr +4 );/* Set the IRQ line. */ +#ifndef CONFIG_PC9800 outw ((dev->irq <<12 ) |0x0f00 , ioaddr +WN0_IRQ ); +#else + { +int irq = dev->irq; +if (irq ==6 ) + irq =7 ; +else if (irq ==13 ) + irq =15 ; +outw ((irq <<12 ) |0x0f00 , ioaddr +WN0_IRQ ); + } +#endif /* Set the station address in window 2 each time opened. */ EL3WINDOW (2 );
drivers/net/8390.h +2 -1
@@ -123,7 +123,8 @@#define inb_p (port) in_8(port)#define outb_p (val,port) out_8(port,val) -#elif defined(CONFIG_ARM_ETHERH ) || defined(CONFIG_ARM_ETHERH_MODULE ) +#elif defined(CONFIG_ARM_ETHERH ) || defined(CONFIG_ARM_ETHERH_MODULE ) || \ + defined(CONFIG_NET_CBUS )#define EI_SHIFT (x) (ei_local->reg_offset[x])#else #define EI_SHIFT (x) (x)
drivers/net/Kconfig +52 -3
79 lines not on this page · raw message
drivers/net/Makefile +1 -0
@@ -90,6 +90,7 @@ obj-$(CONFIG_WD80x3) += wd.o 8390.o obj-$(CONFIG_EL2) += 3c503.o 8390.o obj-$(CONFIG_NE2000) += ne.o 8390.o +obj-$(CONFIG_NE2K_CBUS) += ne.o 8390.o obj-$(CONFIG_NE2_MCA) += ne2.o 8390.o obj-$(CONFIG_HPLAN) += hp.o 8390.o obj-$(CONFIG_HPLAN_PLUS) += hp-plus.o 8390.o
drivers/net/Makefile.lib +1 -0
@@ -19,6 +19,7 @@ obj-$(CONFIG_MACMACE) += crc32.o obj-$(CONFIG_MIPS_AU1000_ENET) += crc32.o obj-$(CONFIG_NATSEMI) += crc32.o +obj-$(CONFIG_NE2K_CBUS) += crc32.o obj-$(CONFIG_PCMCIA_FMVJ18X) += crc32.o obj-$(CONFIG_PCMCIA_SMC91C92) += crc32.o obj-$(CONFIG_PCMCIA_XIRTULIP) += crc32.o
drivers/net/Space.c +1 -1
@@ -242,7 +242,7 @@ #ifdef CONFIG_E2100 /* Cabletron E21xx series. */ {e2100_probe, 0}, #endif -#ifdef CONFIG_NE2000 /* ISA (use ne2k-pci for PCI cards) */ +#if defined(CONFIG_NE2000) || defined(CONFIG_NE2K_CBUS) /* ISA & PC-9800 CBUS (use ne2k-pci for PCI cards) */ {ne_probe, 0}, #endif #ifdef CONFIG_LANCE /* ISA/VLB (use pcnet32 for PCI cards) */
drivers/net/at1700.c +102 -13
249 lines not on this page · raw message
drivers/net/ne.c +345 -14
568 lines not on this page · raw message
drivers/net/ne2k_cbus.h +481 -0
481 lines not on this page · raw message
PATCH 1/1 PC-9800 addtional for 2.5.50-ac1 (10/21)
In reply to Osamu TomitaNEC PC-9800 subarchitecture support patch for 2.5.50-ac1 (10/21) For support PC98 specific partition table and for compatibility FAT fs made by PC98's MS-DOS.
diffstat:
fs/fat/inode.c | 5 fs/partitions/Kconfig | 7 + fs/partitions/Makefile | 1 fs/partitions/check.c | 4 fs/partitions/msdos.c | 2 fs/partitions/nec98.c | 272 +++++++++++++++++++++++++++++++++++++++++++++++++ fs/partitions/nec98.h | 10 + 7 files changed, 299 insertions(+), 2 deletions(-)
Regards,
Osamu Tomita
fs/fat/inode.c +4 -1
@@ -50,6 +50,7 @@#define FAT_HASH_MASK (FAT_HASH_SIZE-1)static struct list_head fat_inode_hashtable[FAT_HASH_SIZE ];spinlock_t fat_inode_lock =SPIN_LOCK_UNLOCKED ; +extern int pc98;/* whether PC-9801 architecutre or not */ void fat_hash_init (void ) {
@@ -930,7 +931,9 @@ error = first; goto out_fail; } -if (FAT_FIRST_ENT (sb, media) != first) { +if (FAT_FIRST_ENT (sb, media) != first + && (!pc98 || media !=0xf8 || (first &0xff ) !=0xfe )) + {if (!silent) { printk(KERN_ERR "FAT: invalid first entry of FAT " "(0x%x != 0x%x)\n",
fs/partitions/Kconfig +7 -0
@@ -177,6 +177,13 @@ If unsure, say N. +config NEC98_PARTITION + bool "NEC PC-9800 partition table support" if PARTITION_ADVANCED + default y if !PARTITION_ADVANCED && PC9800 + help + Say Y here if you would like to be able to read the hard disk + partition table format used by NEC PC-9800 machines. + config SGI_PARTITION bool "SGI partition support" if PARTITION_ADVANCED default y if !PARTITION_ADVANCED && (SGI_IP22 || SGI_IP27)
fs/partitions/Makefile +1 -0
@@ -18,6 +18,7 @@ obj-$(CONFIG_ULTRIX_PARTITION) += ultrix.o obj-$(CONFIG_IBM_PARTITION) += ibm.o obj-$(CONFIG_EFI_PARTITION) += efi.o +obj-$(CONFIG_NEC98_PARTITION) += nec98.o msdos.o include $(TOPDIR)/Rules.make
fs/partitions/check.c +4 -0
@@ -29,6 +29,7 @@#include "ldm.h" #include "mac.h" #include "msdos.h" +#include "nec98.h" #include "osf.h" #include "sgi.h" #include "sun.h"
@@ -52,6 +53,9 @@#ifdef CONFIG_LDM_PARTITION ldm_partition, /* this must come before msdos */#endif +#ifdef CONFIG_NEC98_PARTITION + nec98_partition, /* must be come before `msdos_partition' */ +#endif #ifdef CONFIG_MSDOS_PARTITION msdos_partition,#endif
fs/partitions/msdos.c +1 -1
@@ -219,7 +219,7 @@* Create devices for BSD partitions listed in a disklabel, under a * dos-like partition. See parse_extended() for more information. */ -static void +void parse_bsd (struct parsed_partitions *state,struct block_device *bdev,u32 offset,u32 size,int origin,char *flavour,int max_partitions)
fs/partitions/nec98.c +272 -0
272 lines not on this page · raw message
fs/partitions/nec98.h +10 -0
@@ -0,0 +1,10 @@ +/* +* NEC PC-9800 series partition supports +* +* Copyright (C) 1998-2000 Kyoto University Microcomputer Club +*/ + +#define NEC98_PTABLE_MAGIC 0xAA55 + +extern int nec98_partition (struct parsed_partitions *state, +struct block_device *bdev);
PATCH 1/1 PC-9800 addtional for 2.5.50-ac1 (11/21)
In reply to Osamu TomitaNEC PC-9800 subarchitecture support patch for 2.5.50-ac1 (11/21) This is support for standard IDE I/F of PC98.
diffstat:
drivers/ide/Kconfig | 5 drivers/ide/ide-disk.c | 67 +++ drivers/ide/ide-geometry.c | 2 drivers/ide/ide-probe.c | 23 - drivers/ide/ide-proc.c | 3 drivers/ide/ide.c | 14 drivers/ide/legacy/Makefile | 5 drivers/ide/legacy/hd98.c | 904 ++++++++++++++++++++++++++++++++++++++++++++ drivers/ide/legacy/pc9800.c | 82 +++ include/asm-i386/ide.h | 18 include/linux/hdreg.h | 19 include/linux/ide.h | 2 12 files changed, 1138 insertions(+), 6 deletions(-)
Regards,
Osamu Tomita
drivers/ide/Kconfig +5 -0
@@ -1016,6 +1016,11 @@ If unsure, say N. +config BLK_DEV_IDE_PC9800 + bool + depends on PC9800 + default y + ##if [ "$CONFIG_IDE_TASKFILE_IO" = "y" ]; then ## dep_mbool CONFIG_BLK_DEV_TF_DISK $CONFIG_BLK_DEV_IDEDISK ##else
drivers/ide/ide-disk.c +67 -0
79 lines not on this page · raw message
drivers/ide/ide-geometry.c +2 -0
@@ -6,6 +6,7 @@#include <linux/mc146818rtc.h> #include <asm/io.h> +#ifndef CONFIG_PC9800 /* * We query CMOS about hard disks : it could be that we have a SCSI/ESDI/etc * controller that is BIOS compatible with ST-506, and thus showing up in our
@@ -81,6 +82,7 @@ }#endif } +#endif /* !CONFIG_PC9800 */ extern unsigned long current_capacity (ide_drive_t *);
drivers/ide/ide-probe.c +19 -4
@@ -55,6 +55,11 @@#include <asm/io.h> /* +* Whether PC-9800 architecture or not. +*/ +extern int pc98; + +/* * CompactFlash cards and their brethern pretend to be removable * hard disks, except: * (1) they never have a slave unit, and
@@ -573,7 +578,7 @@if (hwif->mmio ==2 )return 0 ; - addr_errs =hwif_check_region (hwif, hwif->io_ports[IDE_DATA_OFFSET ],1 ); + addr_errs =hwif_check_region (hwif, hwif->io_ports[IDE_DATA_OFFSET ], pc98 ?2 :1 );for (i =IDE_ERROR_OFFSET ; i <=IDE_STATUS_OFFSET ; i++) addr_errs +=hwif_check_region (hwif, hwif->io_ports[i],1 );if (hwif->io_ports[IDE_CONTROL_OFFSET ])
@@ -622,7 +627,9 @@ }for (i =IDE_DATA_OFFSET ; i <=IDE_STATUS_OFFSET ; i++) -hwif_request_region (hwif->io_ports[i],1 , hwif->name); +hwif_request_region (hwif->io_ports[i], + (pc98 && i ==IDE_DATA_OFFSET ) ?2 :1 , + hwif->name); }//EXPORT_SYMBOL(hwif_register);
@@ -639,7 +646,7 @@if (hwif->noprobe)return ; -#ifdef CONFIG_BLK_DEV_IDE +#if !defined(CONFIG_PC9800 ) && defined(CONFIG_BLK_DEV_IDE )if (hwif->io_ports[IDE_DATA_OFFSET ] ==HD_DATA ) {extern void probe_cmos_for_drives (ide_hwif_t *);probe_cmos_for_drives (hwif);
@@ -650,6 +657,9 @@#if CONFIG_BLK_DEV_PDC4030 (hwif->chipset != ide_pdc4030 || hwif->channel == 0) &&#endif /* CONFIG_BLK_DEV_PDC4030 */ +#if CONFIG_BLK_DEV_IDE_PC9800 + (hwif->chipset != ide_pc9800 || !hwif->mate->present) && +#endif (hwif_check_regions(hwif))) {u16 msgout =0 ;for (unit =0 ; unit <MAX_DRIVES ; ++unit) {
@@ -979,7 +989,7 @@/* all CPUs; safe now that hwif->hwgroup is set up */ spin_unlock_irqrestore (&ide_lock, flags); -#if !defined(__mc68000__) && !defined(CONFIG_APUS ) && !defined(__sparc__) +#if !defined(__mc68000__) && !defined(CONFIG_APUS ) && !defined(__sparc__) && !defined(CONFIG_PC9800 ) printk("%s at 0x%03lx-0x%03lx,0x%03lx on irq %d", hwif->name, hwif->io_ports[IDE_DATA_OFFSET], hwif->io_ports[IDE_DATA_OFFSET]+7,
@@ -989,6 +999,11 @@ hwif->io_ports[IDE_DATA_OFFSET ], hwif->io_ports[IDE_DATA_OFFSET ]+7 , hwif->io_ports[IDE_CONTROL_OFFSET], __irq_itoa(hwif->irq)); +#elif defined(CONFIG_PC9800 ) +printk ("%s at 0x%03lx-0x%03lx,0x%03lx on irq %d" , hwif->name, + hwif->io_ports[IDE_DATA_OFFSET ], + hwif->io_ports[IDE_DATA_OFFSET ]+15 , + hwif->io_ports[IDE_CONTROL_OFFSET ], hwif->irq);#else printk ("%s at %x on irq 0x%08x" , hwif->name, hwif->io_ports[IDE_DATA_OFFSET ], hwif->irq);
drivers/ide/ide-proc.c +3 -0
@@ -365,6 +365,9 @@case ide_cy82c693: name ="cy82c693" ;break ;case ide_4drives: name ="4drives" ;break ;case ide_pmac: name ="mac-io" ;break ; +#ifdef CONFIG_PC9800 +case ide_pc9800: name ="pc9800" ;break ; +#endif default : name ="(unknown)" ;break ; } len =sprintf (page,"%s\n" , name);
drivers/ide/ide.c +13 -1
@@ -189,6 +189,11 @@int ide_intr_lock;#endif /* IDE_ARCH_LOCK */ +/* +* Whether PC-9800 architecture or not. +*/ +extern int pc98; +#ifdef CONFIG_IDEDMA_AUTO int noautodma =0 ;#else
@@ -555,7 +560,8 @@ }for (i =IDE_DATA_OFFSET ; i <=IDE_STATUS_OFFSET ; i++) {if (hwif->io_ports[i]) { -hwif_release_region (hwif->io_ports[i],1 ); +hwif_release_region (hwif->io_ports[i], + (pc98 && i ==IDE_DATA_OFFSET ) ?2 :1 ); } } }
@@ -2020,6 +2026,12 @@ }#endif /* CONFIG_BLK_DEV_IDEPCI */ +#ifdef CONFIG_BLK_DEV_IDE_PC9800 + { +extern void ide_probe_for_pc9800 (void ); +ide_probe_for_pc9800 (); + } +#endif #ifdef CONFIG_ETRAX_IDE {extern void init_e100_ide (void );
drivers/ide/legacy/Makefile +5 -0
@@ -2,6 +2,7 @@ obj-$(CONFIG_BLK_DEV_ALI14XX) += ali14xx.o obj-$(CONFIG_BLK_DEV_DTC2278) += dtc2278.o obj-$(CONFIG_BLK_DEV_HT6560B) += ht6560b.o +obj-$(CONFIG_BLK_DEV_IDE_PC9800) += pc9800.o obj-$(CONFIG_BLK_DEV_PDC4030) += pdc4030.o obj-$(CONFIG_BLK_DEV_QD65XX) += qd65xx.o obj-$(CONFIG_BLK_DEV_UMC8672) += umc8672.o
@@ -15,7 +16,11 @@ obj-$(CONFIG_BLK_DEV_IDECS) += ide-cs.o # Last of all +ifneq ($(CONFIG_PC9800),y) obj-$(CONFIG_BLK_DEV_HD) += hd.o +else +obj-$(CONFIG_BLK_DEV_HD) += hd98.o +endif EXTRA_CFLAGS := -Idrivers/ide
drivers/ide/legacy/hd98.c +904 -0
904 lines not on this page · raw message
drivers/ide/legacy/pc9800.c +82 -0
82 lines not on this page · raw message
include/asm-i386/ide.h +18 -0
@@ -26,6 +26,9 @@static __inline__int ide_default_irq (ide_ioreg_t base) {switch (base) { +#ifdef CONFIG_PC9800 +case 0x640 :return 9 ; +#endif /* CONFIG_PC9800 */ case 0x1f0 :return 14 ;case 0x170 :return 15 ;case 0x1e8 :return 11 ;
@@ -39,7 +42,11 @@static __inline__ide_ioreg_t ide_default_io_base (int index) { +#ifndef CONFIG_PC9800 static unsigned long ata_io_base[MAX_HWIFS ] = {0x1f0 ,0x170 ,0x1e8 ,0x168 ,0x1e0 ,0x160 }; +#else /* CONFIG_PC9800 */ +static unsigned long ata_io_base[MAX_HWIFS ] = {0x640 ,0x640 ,0 ,0 ,0 ,0 }; +#endif /* !CONFIG_PC9800 */ return ata_io_base[index]; }
@@ -48,13 +55,24 @@ {ide_ioreg_t reg = data_port;int i; +#ifdef CONFIG_PC9800 +ide_ioreg_t increment = data_port ==0x640 ?2 :1 ; +#endif for (i =IDE_DATA_OFFSET ; i <=IDE_STATUS_OFFSET ; i++) { hw->io_ports[i] = reg; +#ifndef CONFIG_PC9800 reg +=1 ; +#else + reg += increment; +#endif }if (ctrl_port) { hw->io_ports[IDE_CONTROL_OFFSET ] = ctrl_port; +#ifdef CONFIG_PC9800 + }else if (data_port ==0x640 ) { + hw->io_ports[IDE_CONTROL_OFFSET ] =0x74c ; +#endif }else { hw->io_ports[IDE_CONTROL_OFFSET ] = hw->io_ports[IDE_DATA_OFFSET ] +0x206 ; }
include/linux/hdreg.h +19 -0
@@ -5,11 +5,13 @@* This file contains some defines for the AT-hd-controller. * Various sources. */ +#include <linux/config.h> /* ide.c has its own port definitions in "ide.h" */ #define HD_IRQ 14 +#ifndef CONFIG_PC9800 /* Hd controller regs. Ref: IBM AT Bios-listing */ #define HD_DATA 0x1f0/* _CTL when writing */ #define HD_ERROR 0x1f1/* see err-bits */
@@ -25,6 +27,23 @@#define HD_CMD 0x3f6/* used for resets */ #define HD_ALTSTATUS 0x3f6/* same as HD_STATUS but doesn't clear irq */ +#else /* CONFIG_PC9800 */ +/* Hd controller regs. for NEC PC-9800 */ +#define HD_DATA 0x640/* _CTL when writing */ +#define HD_ERROR 0x642/* see err-bits */ +#define HD_NSECTOR 0x644/* nr of sectors to read/write */ +#define HD_SECTOR 0x646/* starting sector */ +#define HD_LCYL 0x648/* starting cylinder */ +#define HD_HCYL 0x64a/* high byte of starting cyl */ +#define HD_CURRENT 0x64c/* 101dhhhh , d=drive, hhhh=head */ +#define HD_STATUS 0x64e/* see status-bits */ +#define HD_FEATURE HD_ERROR/* same io address, read=error, write=feature */ +#define HD_PRECOMP HD_FEATURE/* obsolete use of this port - predates IDE */ +#define HD_COMMAND HD_STATUS/* same io address, read=status, write=cmd */ + +#define HD_CMD 0x74c/* used for resets */ +#define HD_ALTSTATUS 0x74c/* same as HD_STATUS but doesn't clear irq */ +#endif /* CONFIG_PC9800 */ /* remainder is shared between hd.c, ide.c, ide-cd.c, and the hdparm utility */
include/linux/ide.h +1 -1
@@ -294,7 +294,7 @@ ide_qd65xx, ide_umc8672, ide_ht6560b, ide_pdc4030, ide_rz1000, ide_trm290, ide_cmd646, ide_cy82c693, ide_4drives, - ide_pmac, ide_etrax100, ide_acorn + ide_pmac, ide_etrax100, ide_acorn, ide_pc9800 } hwif_chipset_t; typedef struct ide_io_ops_s {
PATCH 1/1 PC-9800 addtional for 2.5.50-ac1 (12/21)
In reply to Osamu TomitaNEC PC-9800 subarchitecture support patch for 2.5.50-ac1 (10/21) This patch contains changes under include/asm-i386/*.
diffstat:
include/asm-i386/dma.h | 7 + include/asm-i386/io.h | 6 + include/asm-i386/irq.h | 4 include/asm-i386/pc9800.h | 27 ++++ include/asm-i386/pc9800_dma.h | 238 +++++++++++++++++++++++++++++++++++++++++ include/asm-i386/pgtable.h | 4 include/asm-i386/scatterlist.h | 6 + include/asm-i386/timex.h | 4 8 files changed, 296 insertions(+)
Regards,
Osamu Tomita
include/asm-i386/dma.h +7 -0
@@ -10,6 +10,9 @@#include <linux/config.h> #include <linux/spinlock.h> /* And spinlocks */ +#ifdef CONFIG_PC9800 +#include <asm/pc9800_dma.h> +#else /* !CONFIG_PC9800 */ #include <asm/io.h> /* need byte IO */ #include <linux/delay.h>
@@ -72,8 +75,10 @@#define MAX_DMA_CHANNELS 8 +#ifndef CONFIG_PC9800 /* The maximum address that we can perform a DMA transfer to on this platform */ #define MAX_DMA_ADDRESS (PAGE_OFFSET+0x1000000) +#endif /* 8237 DMA controllers */ #define IO_DMA1_BASE 0x00/* 8 bit slave DMA, channels 0..3 */
@@ -295,4 +300,6 @@#define isa_dma_bridge_buggy (0)#endif +#endif /* CONFIG_PC9800 */ +#endif /* _ASM_DMA_H */
include/asm-i386/io.h +6 -0
@@ -27,6 +27,8 @@* Linus */ +#include <linux/config.h> +/* * Bit simplified and optimized by Jan Hubicka * Support of BIGMEM added by Gerhard Wichert, Siemens AG, July 1999.
@@ -288,7 +290,11 @@#ifdef SLOW_IO_BY_JUMPING #define __SLOW_DOWN_IO "jmp 1f; 1: jmp 1f; 1:"#else +#ifndef CONFIG_PC9800 #define __SLOW_DOWN_IO "outb %%al,$0x80;" +#else +#define __SLOW_DOWN_IO "outb %%al,$0x5f;" +#endif #endif static inline void slow_down_io (void ) {
include/asm-i386/irq.h +4 -0
@@ -17,7 +17,11 @@static __inline__int irq_cannonicalize (int irq) { +#ifndef CONFIG_PC9800 return ((irq ==2 ) ?9 : irq); +#else +return ((irq ==7 ) ?11 : irq); +#endif }extern void disable_irq (unsigned int );
include/asm-i386/pc9800.h +27 -0
@@ -0,0 +1,27 @@ +/* +* PC-9800 machine types. +* +* Copyright (C) 1999 TAKAI Kosuke <[email protected]> +* (Linux/98 Project) +*/ + +#ifndef _ASM_PC9800_H_ +#define _ASM_PC9800_H_ + +#include <asm/pc9800_sca.h> +#include <asm/types.h> + +#define __PC9800SCA (type, pa) (*(type *) phys_to_virt(pa)) +#define __PC9800SCA_TEST_BIT (pa, n) \ + ((__PC9800SCA(u8, pa) & (1U << (n))) != 0) + +#define PC9800_HIGHRESO_P () __PC9800SCA_TEST_BIT(PC9800SCA_BIOS_FLAG, 3) +#define PC9800_8MHz_P () __PC9800SCA_TEST_BIT(PC9800SCA_BIOS_FLAG, 7) + +/* 0x2198 is 98 21 on memory... */ +#define PC9800_9821_P () (__PC9800SCA(u16, PC9821SCA_ROM_ID) == 0x2198) + +/* Note PC9821_...() are valid only when PC9800_9821_P() was true. */ +#define PC9821_IDEIF_DOUBLE_P () __PC9800SCA_TEST_BIT(PC9821SCA_ROM_FLAG4, 4) + +#endif
include/asm-i386/pc9800_dma.h +238 -0
238 lines not on this page · raw message
include/asm-i386/pgtable.h +4 -0
@@ -58,7 +58,11 @@#endif #endif +#ifndef CONFIG_PC9800 #define __beep () asm("movb $0x3,%al; outb %al,$0x61") +#else +#define __beep () asm("movb $0x6,%al; outb %al,$0x37") +#endif #define PMD_SIZE (1UL << PMD_SHIFT)#define PMD_MASK (~(PMD_SIZE-1))
include/asm-i386/scatterlist.h +6 -0
@@ -1,6 +1,8 @@ #ifndef _I386_SCATTERLIST_H #define _I386_SCATTERLIST_H +#include <linux/config.h> + struct scatterlist { struct page *page; unsigned int offset;
@@ -8,6 +10,10 @@ unsigned int length; }; +#ifdef CONFIG_PC9800 +#define ISA_DMA_THRESHOLD (0xffffffff) +#else #define ISA_DMA_THRESHOLD (0x00ffffff) +#endif #endif /* !(_I386_SCATTERLIST_H) */
include/asm-i386/timex.h +4 -0
@@ -9,11 +9,15 @@#include <linux/config.h> #include <asm/msr.h> +#ifdef CONFIG_PC9800 +extern int CLOCK_TICK_RATE ; +#else #ifdef CONFIG_MELAN # define CLOCK_TICK_RATE 1189200/* AMD Elan has different frequency! */ #else # define CLOCK_TICK_RATE 1193180/* Underlying HZ */ #endif +#endif #define CLOCK_TICK_FACTOR 20/* Factor of both 1000000 and CLOCK_TICK_RATE */ #define FINETUNE ((((((long)LATCH * HZ - CLOCK_TICK_RATE) << SHIFT_HZ) * \
PATCH 1/1 PC-9800 addtional for 2.5.50-ac1 (13/21)
In reply to Osamu TomitaNEC PC-9800 subarchitecture support patch for 2.5.50-ac1 (13/21) This patch contains PC speaker driver for PC98 and changes for support japanese "KANA" characters. Japanese keybord has KANA shift key and KANA LED.
diffstat:
drivers/char/keyboard.c | 4 + drivers/input/misc/98spkr.c | 95 ++++++++++++++++++++++++++++++++++++++++++++ drivers/input/misc/Kconfig | 4 + drivers/input/misc/Makefile | 1 include/linux/kbd_kern.h | 5 +- include/linux/keyboard.h | 1 6 files changed, 108 insertions(+), 2 deletions(-)
Regards,
Osamu Tomita
drivers/input/misc/98spkr.c +95 -0
@@ -0,0 +1,95 @@ +/* +* PC-9800 Speaker beeper driver for Linux +* +* Copyright (c) 2002 Osamu Tomita +* Copyright (c) 2002 Vojtech Pavlik +* Copyright (c) 1992 Orest Zborowski +* +*/ + +/* +* This program is free software; you can redistribute it and/or modify it +* under the terms of the GNU General Public License version 2 as published by +* the Free Software Foundation +*/ + +#include <linux/kernel.h> +#include <linux/module.h> +#include <linux/init.h> +#include <linux/input.h> +#include <asm/io.h> + +MODULE_AUTHOR ("Osamu Tomita <[email protected]>" ); +MODULE_DESCRIPTION ("PC-9800 Speaker beeper driver" ); +MODULE_LICENSE ("GPL" ); + +static char spkr98_name[] ="PC-9801 Speaker" ; +static char spkr98_phys[] ="isa3fdb/input0" ; +static struct input_dev spkr98_dev; + +spinlock_t i8253_beep_lock =SPIN_LOCK_UNLOCKED ; + +static int spkr98_event (struct input_dev *dev,unsigned int type,unsigned int code,int value) +{ +unsigned int count =0 ; +unsigned long flags; + +if (type !=EV_SND ) +return -1 ; + +switch (code) { +case SND_BELL :if (value) value =1000 ; +case SND_TONE :break ; +default :return -1 ; + } + +if (value >20 && value <32767 ) + count =CLOCK_TICK_RATE / value; + +spin_lock_irqsave (&i8253_beep_lock, flags); + +if (count) { +outb (0x76 ,0x3fdf ); +outb (0 ,0x5f ); +outb (count &0xff ,0x3fdb ); +outb (0 ,0x5f ); +outb ((count >>8 ) &0xff ,0x3fdb ); +/* beep on */ +outb (6 ,0x37 ); + }else { +/* beep off */ +outb (7 ,0x37 ); + } + +spin_unlock_irqrestore (&i8253_beep_lock, flags); + +return 0 ; +} + +static int __init spkr98_init (void ) +{ + spkr98_dev.evbit[0 ] =BIT (EV_SND ); + spkr98_dev.sndbit[0 ] =BIT (SND_BELL ) |BIT (SND_TONE ); + spkr98_dev.event = spkr98_event; + + spkr98_dev.name = spkr98_name; + spkr98_dev.phys = spkr98_phys; + spkr98_dev.id.bustype =BUS_ISA ; + spkr98_dev.id.vendor =0x001f ; + spkr98_dev.id.product =0x0001 ; + spkr98_dev.id.version =0x0100 ; + +input_register_device (&spkr98_dev); + +printk (KERN_INFO "input: %s\n" , spkr98_name); + +return 0 ; +} + +static void __exit spkr98_exit(void) +{ +input_unregister_device (&spkr98_dev); +} + +module_init (spkr98_init); +module_exit (spkr98_exit);
drivers/input/misc/Kconfig +4 -0
@@ -44,6 +44,10 @@ tristate "M68k Beeper support" depends on M68K && INPUT && INPUT_MISC +config INPUT_98SPKR + tristate "PC-9800 Speaker support" + depends on PC9800 && INPUT && INPUT_MISC + config INPUT_UINPUT tristate "User level driver support" depends on INPUT && INPUT_MISC
drivers/input/misc/Makefile +1 -0
@@ -7,6 +7,7 @@ obj-$(CONFIG_INPUT_SPARCSPKR) += sparcspkr.o obj-$(CONFIG_INPUT_PCSPKR) += pcspkr.o obj-$(CONFIG_INPUT_M68K_BEEP) += m68kspkr.o +obj-$(CONFIG_INPUT_98SPKR) += 98spkr.o obj-$(CONFIG_INPUT_UINPUT) += uinput.o # The global Rules.make.
drivers/char/keyboard.c +4 -0
@@ -58,7 +58,11 @@* Some laptops take the 789uiojklm,. keys as number pad when NumLock is on. * This seems a good reason to start with NumLock off. */ +#ifndef CONFIG_PC9800 #define KBD_DEFLEDS 0 +#else +#define KBD_DEFLEDS (1 << VC_NUMLOCK) +#endif #endif #ifndef KBD_DEFLOCK
include/linux/kbd_kern.h +3 -2
@@ -43,11 +43,12 @@#define LED_SHOW_IOCTL 1/* only change leds upon ioctl */ #define LED_SHOW_MEM 2/* `heartbeat': peek into memory */ - unsigned char ledflagstate:3; /* flags, not lights */ - unsigned char default_ledflagstate:3; + unsigned char ledflagstate:4; /* flags, not lights */ + unsigned char default_ledflagstate:4;#define VC_SCROLLOCK 0/* scroll-lock mode */ #define VC_NUMLOCK 1/* numeric lock mode */ #define VC_CAPSLOCK 2/* capslock mode */ +#define VC_KANALOCK 3/* kanalock mode */ unsigned char kbdmode:2; /* one 2-bit value */#define VC_XLATE 0/* translate keycodes using keymap */
include/linux/keyboard.h +1 -0
@@ -9,6 +9,7 @@#define KG_ALT 3#define KG_ALTGR 1#define KG_SHIFTL 4 +#define KG_KANASHIFT 4#define KG_SHIFTR 5#define KG_CTRLL 6#define KG_CTRLR 7
PATCH 1/1 PC-9800 addtional for 2.5.50-ac1 (14/21)
In reply to Osamu TomitaNEC PC-9800 subarchitecture support patch for 2.5.50-ac1 (14/21) This patch contains changes under kernel/*.
diffstat:
kernel/dma.c | 3 +++ kernel/ksyms.c | 4 ++++ kernel/timer.c | 5 +++++ 3 files changed, 12 insertions(+)
Regards,
Osamu Tomita
kernel/dma.c +3 -0
@@ -9,6 +9,7 @@* [It also happened to remove the sizeof(char *) == sizeof(int) * assumption introduced because of those /proc/dma patches. -- Hennus] */ +#include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/errno.h>
@@ -62,10 +63,12 @@ { 0, 0 }, { 0, 0 }, { 0, 0 }, +#ifndef CONFIG_PC9800 { 1, "cascade" }, { 0, 0 }, { 0, 0 }, { 0, 0 } +#endif };
kernel/ksyms.c +4 -0
@@ -604,6 +604,10 @@EXPORT_SYMBOL (__per_cpu_offset);#endif +/* Whether PC-9800 architecture or not No:0 Yes:1 */ +int pc98 =0 ; +EXPORT_SYMBOL (pc98); +/* debug */ EXPORT_SYMBOL (dump_stack);
kernel/timer.c +5 -0
@@ -433,8 +433,13 @@/* * Timekeeping variables */ +#ifndef CONFIG_PC9800 unsigned long tick_usec =TICK_USEC ;/* ACTHZ period (usec) */ unsigned long tick_nsec =TICK_NSEC (TICK_USEC );/* USER_HZ period (nsec) */ +#else +extern unsigned long tick_usec;/* ACTHZ period (usec) */ +extern unsigned long tick_nsec;/* USER_HZ period (nsec) */ +#endif /* The current time */ struct timespec xtime __attribute__ ((aligned (16)));
PATCH 1/1 PC-9800 addtional for 2.5.50-ac1 (15/21)
In reply to Osamu TomitaNEC PC-9800 subarchitecture support patch for 2.5.50-ac1 (15/21) This is support for standard parallel port of PC98.
diffstat:
drivers/parport/parport_pc.c | 68 +++++++++++++++++++++++++++++++++++++++---- include/linux/parport_pc.h | 10 ++++++ 2 files changed, 73 insertions(+), 5 deletions(-)
Regards,
Osamu Tomita
drivers/parport/parport_pc.c +63 -5
@@ -85,6 +85,8 @@ #define DPRINTK(stuff...)#endif +/* Indicates PC-9800 architecture No:0 Yes:1 */ +extern int pc98;#define NR_SUPERIOS 3 static struct superio_struct { /* For Super-IO chips autodetection */
@@ -332,7 +334,10 @@unsigned char parport_pc_read_status (struct parport *p) { -return inb (STATUS (p)); +if (pc98 && p->base ==0x40 ) +return ((inb (0x42 ) &0x04 ) <<5 ) |PARPORT_STATUS_ERROR ; +else +return inb (STATUS (p)); }void parport_pc_disable_irq (struct parport *p)
@@ -1644,6 +1649,8 @@ {unsigned char r, w; +if (pc98 && pb->base ==0x40 ) +return PARPORT_MODE_PCSPP ;/* * first clear an eventually pending EPP timeout * I ([email protected]) have an SMSC chipset
@@ -1777,6 +1784,9 @@ {int ok =0 ; +if (pc98 && pb->base ==0x40 ) +return 0 ;/* never support */ +clear_epp_timeout (pb);/* try to tri-state the buffer */
@@ -1908,6 +1918,9 @@ config & 0x80 ? "Level" : "Pulses"); configb =inb (CONFIGB (pb)); +if (pc98 && (CONFIGB (pb) ==0x14d ) && ((configb &0x38 ) ==0x30 )) + configb = (configb & ~0x38 ) |0x28 ;/* IRQ 14 */ +printk (KERN_DEBUG "0x%lx: ECP port cfgA=0x%02x cfgB=0x%02x\n" , pb->base, config, configb);printk (KERN_DEBUG "0x%lx: ECP settings irq=" , pb->base);
@@ -2048,6 +2061,9 @@ECR_WRITE (pb,ECR_CNF <<5 );/* Configuration MODE */ intrLine = (inb (CONFIGB (pb)) >>3 ) &0x07 ; +if (pc98 && (CONFIGB (pb) ==0x14d ) && (intrLine ==6 )) + intrLine =5 ;/* IRQ 14 */ + irq = lookup[intrLine];ECR_WRITE (pb, oecr);
@@ -2212,7 +2228,14 @@struct parport tmp;struct parport *p = &tmp;int probedirq =PARPORT_IRQ_NONE ; -if (check_region (base,3 ))return NULL ; +if (pc98 && base ==0x40 ) { +int i; +for (i =0 ; i <8 ; i +=2 ) +if (check_region (base + i,1 ))return NULL ; + }else { +if (check_region (base,3 ))return NULL ; + } + priv =kmalloc (sizeof (struct parport_pc_private ),GFP_KERNEL );if (!priv) {printk (KERN_DEBUG "parport (0x%lx): no memory!\n" , base);
@@ -2245,7 +2268,7 @@if (base_hi && !check_region (base_hi,3 ))parport_ECR_present (p); -if (base !=0x3bc ) { +if (!pc98 && base !=0x3bc ) {if (!check_region (base+0x3 ,5 )) {if (!parport_EPP_supported (p))parport_ECPEPP_supported (p);
@@ -2343,7 +2366,12 @@printk (KERN_INFO "%s: irq %d detected\n" , p->name, probedirq);parport_proc_register (p); -request_region (p->base,3 , p->name); +if (pc98 && p->base ==0x40 ) { +int i; +for (i =0 ; i <8 ; i +=2 ) +request_region (p->base + i,1 , p->name); + }else +request_region (p->base,3 , p->name);if (p->size >3 )request_region (p->base +3 , p->size -3 , p->name);if (p->modes &PARPORT_MODE_ECP )
@@ -2413,7 +2441,13 @@free_dma (p->dma);if (p->irq !=PARPORT_IRQ_NONE )free_irq (p->irq, p); -release_region (p->base,3 ); +if (pc98 && p->base ==0x40 ) { +int i; +for (i =0 ; i <8 ; i +=2 ) +release_region (p->base + i,1 ); + }else +release_region (p->base,3 ); +if (p->size >3 )release_region (p->base +3 , p->size -3 );if (p->modes &PARPORT_MODE_ECP )
@@ -2996,6 +3030,30 @@ {int count =0 ; +if (pc98) { +/* Set default resource settings for old style parport */ +int base =0x40 ; +int base_hi =0 ; +int irq =PARPORT_IRQ_NONE ; +int dma =PARPORT_DMA_NONE ; + +/* Check PC9800 old style parport */ +outb (inb (0x149 ) & ~0x10 ,0x149 );/* disable IEEE1284 */ +if (!(inb (0x149 ) &0x10 )) {/* IEEE1284 disabled ? */ +outb (inb (0x149 ) |0x10 ,0x149 );/* enable IEEE1284 */ +if (inb (0x149 ) &0x10 ) {/* IEEE1284 enabled ? */ +/* Set default settings for IEEE1284 parport */ + base =0x140 ; + base_hi =0x14c ; + irq =14 ; +/* dma = PARPORT_DMA_NONE; */ + } + } + +if (parport_pc_probe_port (base, base_hi, irq, dma,NULL )) + count++; + } +if (parport_pc_probe_port (0x3bc ,0x7bc , autoirq, autodma,NULL )) count++;if (parport_pc_probe_port (0x378 ,0x778 , autoirq, autodma,NULL ))
include/linux/parport_pc.h +10 -0
@@ -119,6 +119,11 @@#endif ctr = (ctr & ~mask) ^ val; ctr &= priv->ctr_writable;/* only write writable bits. */ +#ifdef CONFIG_PC9800 +if (p->base ==0x40 && ((priv->ctr) ^ ctr) &0x01 ) +outb (0x0e | ((ctr &0x01 ) ^0x01 ),0x46 ); + else +#endif /* CONFIG_PC9800 */ outb (ctr,CONTROL (p)); priv->ctr = ctr;/* Update soft copy */ return ctr;
@@ -191,6 +196,11 @@extern __inline__unsigned char parport_pc_read_status (struct parport *p) { +#ifdef CONFIG_PC9800 +if (p->base ==0x40 ) +return ((inb (0x42 ) &0x04 ) <<5 ) |PARPORT_STATUS_ERROR ; + else +#endif /* CONFIG_PC9800 */ return inb (STATUS (p)); }
PATCH 1/1 PC-9800 addtional for 2.5.50-ac1 (16/21)
In reply to Osamu TomitaNEC PC-9800 subarchitecture support patch for 2.5.50-ac1 (16/21) This is patch for IRQ number differences in pci drivers.
diffstat:
arch/i386/pci/irq.c | 27 +++++++++++++++++++++++++++ drivers/pcmcia/yenta.c | 6 ++++++ include/asm-i386/pci.h | 4 ++++ 3 files changed, 37 insertions(+)
Regards,
Osamu Tomita
arch/i386/pci/irq.c +27 -0
@@ -5,6 +5,7 @@*/ #include <linux/config.h> +#include <linux/pci_ids.h> #include <linux/types.h> #include <linux/kernel.h> #include <linux/pci.h>
@@ -25,6 +26,7 @@static struct irq_routing_table *pirq_table; +#ifndef CONFIG_PC9800 /* * Never use: 0, 1, 2 (timer, keyboard, and cascade) * Avoid using: 13, 14 and 15 (FP error and IDE).
@@ -36,6 +38,20 @@1000000 ,1000000 ,1000000 ,1000 ,1000 ,0 ,1000 ,1000 ,0 ,0 ,0 ,0 ,1000 ,100000 ,100000 ,100000 }; +#else +/* +* Never use: 0, 1, 2, 7 (timer, keyboard, CRT VSYNC and cascade) +* Avoid using: 8, 9 and 15 (FP error and IDE). +* Penalize: 4, 5, 11, 12, 13, 14 (known ISA uses: serial, floppy, sound, mouse +* and parallel) +*/ +unsigned int pcibios_irq_mask =0xff78 ; + +static int pirq_penalty[16 ] = { +1000000 ,1000000 ,1000000 ,0 ,1000 ,1000 ,0 ,1000000 , +100000 ,100000 ,0 ,1000 ,1000 ,1000 ,1000 ,100000 +}; +#endif struct irq_router {char *name;
@@ -612,6 +628,17 @@ r->set (pirq_router_dev, dev, pirq,11 ); } +#ifdef CONFIG_PC9800 +if ((dev->class >>8 ) ==PCI_CLASS_BRIDGE_CARDBUS ) { +if (pci_find_device (PCI_VENDOR_ID_INTEL , +PCI_DEVICE_ID_INTEL_82439TX ,NULL ) !=NULL ) { +if (mask &0x0040 ) { + mask &=0x0040 ;/* assign IRQ 6 only */ +printk ("pci-irq: Use IRQ6 for CardBus controller\n" ); + } + } + } +#endif /* * Find the best IRQ to assign: use the one * reported by the device if possible.
drivers/pcmcia/yenta.c +6 -0
@@ -8,6 +8,7 @@* Dynamically adjust the size of the bridge resource * */ +#include <linux/config.h> #include <linux/init.h> #include <linux/pci.h> #include <linux/sched.h>
@@ -510,6 +511,7 @@add_timer (&socket->poll_timer); } +#ifndef CONFIG_PC9800 /* * Only probe "regular" interrupts, don't * touch dangerous spots like the mouse irq,
@@ -520,6 +522,10 @@* Default to 11, 10, 9, 7, 6, 5, 4, 3. */ static u32 isa_interrupts =0x0ef8 ; +#else +/* Default to 12, 10, 6, 5, 3. */ +static u32 isa_interrupts =0x1468 ; +#endif static unsigned int yenta_probe_irq (pci_socket_t *socket,u32 isa_irq_mask) {
include/asm-i386/pci.h +4 -0
@@ -17,7 +17,11 @@#endif extern unsigned long pci_mem_start; +#ifndef CONFIG_PC9800 #define PCIBIOS_MIN_IO 0x1000 +#else +#define PCIBIOS_MIN_IO 0x4000 +#endif #define PCIBIOS_MIN_MEM (pci_mem_start)void pcibios_config_init (void );
Problems with OnStream USB30 Tape drive on the USB ports on a FIC VA-503+ - VIA MVP3 Chipset
Hi all,
I am trying to use an On-Stream USB30 Tape drive on a Linux system which
I have running on a FIC VA-503+ motherboard that uses the VIA MVP3 chipset. I am using the standard Linux kernel 2.4.20. And loaded the drivers usb-uhci, usb-storage, and osst to access the tape drive. The tape drive has its latest firmware version. Please not that I also tried the alternate USB driver uhci, which dies even quicker, consistently. The problem is that a very short while after I start a backup to the tape (variable length of time) the backup procedure crashes. The following error message appears to be called every time the procedure crashes.
"
freecom reset called
osst0:W: Warning 70000 (sugg. bt 0x0, driver bt 0x0, host bt 0x7). osst0:W: Command with sense data: Info fld=0xa00 (nonstd), Current osst:ce:00: sns = 70 2
Raw sense data:0x70 0x00 0x02 0x00 0x00 0x0a 0x00 0x00 osst0:W: Command with sense data: Info fld=0xa00 (nonstd), Current osst:ce:00: sns = 70 2
Raw sense data:0x70 0x00 0x02 0x00 0x00 0x0a 0x00 0x00 osst0:W: Command with sense data: Info fld=0xa00 (nonstd), Current osst:ce:00: sns = 70 2
Raw sense data:0x70 0x00 0x02 0x00 0x00 0x0a 0x00 0x00 hub.c: new USB device 00:07.2-2, assigned address 10
WARNING: USB Mass Storage data integrity not assured USB Mass Storage device found at 10
"
The entire dmesg has been pasted below, each of the resets appears to
cause the tape drive to be lost and then reinstalled causing a write error to the process writing to the tape. The problem seams like it might also be time dependant. Before the last tries I made today I was following the README.osst which strongly suggested using 23k blocks when writing to the tape so all my tar commands had the -b64 option. Mysteriously I tried tar without the -b64 option and the backup proceeded for a significantly longer amount of time before succumbing to the problem. I noticed a similar pattern of behavior in the use of dd commands (dd bs=a_block_size if=really_big_file of=/dev/osst0). Smaller block sizes seam to keep the tape drive working for a longer period of time before dying. I also tried telling tar to compress data before writing to the tape with the -z option which also caused the tape drive to last longer.
Note: Tape drive seamed to work on another system where I tried it on
with a later VIA chipset, the SMP VIA P3 chipset. I did a huge backup which did also die, though at this time I'm not sure if its the same problem. The dmesg error messages where different and I may have backed up more data that the space available on the tape. The tape drive did last a really long time though.
I am willing to help debug the problem. Can anyone help me? Thank you.
-------------------------------------------------------------------
Linux version 2.4.20 (root@Miyu) (gcc version 2.95.3 20010315 (release)) #4 Wed Dec 11 17:29:58 EST 2002
BIOS-provided physical RAM map:
BIOS-e820: 0000000000000000 - 000000000009fc00 (usable)
BIOS-e820: 000000000009fc00 - 00000000000a0000 (reserved)
BIOS-e820: 00000000000f0000 - 0000000000100000 (reserved)
BIOS-e820: 0000000000100000 - 0000000007ff0000 (usable)
BIOS-e820: 0000000007ff0000 - 0000000007ff0800 (ACPI NVS)
BIOS-e820: 0000000007ff0800 - 0000000008000000 (ACPI data)
BIOS-e820: 00000000ffff0000 - 0000000100000000 (reserved)
127MB LOWMEM available.
On node 0 totalpages: 32752
zone(0): 4096 pages.
zone(1): 28656 pages.
zone(2): 0 pages.
Kernel command line: auto BOOT_IMAGE=Linux ro root=301 Initializing CPU#0
Detected 451.034 MHz processor.
Console: colour VGA+ 80x25
Calibrating delay loop... 897.84 BogoMIPS
Memory: 127612k/131008k available (934k kernel code, 3008k reserved, 379k data, 64k init, 0k highmem)
Dentry cache hash table entries: 16384 (order: 5, 131072 bytes) Inode cache hash table entries: 8192 (order: 4, 65536 bytes) Mount-cache hash table entries: 2048 (order: 2, 16384 bytes) Buffer-cache hash table entries: 4096 (order: 2, 16384 bytes) Page-cache hash table entries: 32768 (order: 5, 131072 bytes) CPU: L1 I Cache: 32K (32 bytes/line), D cache 32K (32 bytes/line) CPU: After generic, caps: 008021bf 808029bf 00000000 00000002 CPU: Common caps: 008021bf 808029bf 00000000 00000002 CPU: AMD-K6(tm) 3D processor stepping 0c
Checking 'hlt' instruction... OK.
POSIX conformance testing by UNIFIX
mtrr: v1.40 (20010327) Richard Gooch ([email protected])
mtrr: detected mtrr type: AMD K6
PCI: PCI BIOS revision 2.10 entry at 0xfb360, last bus=2
PCI: Using configuration type 1
PCI: Probing PCI hardware
PCI: 00:07.3: class 604 doesn't match header type 00. Ignoring class.
PCI: Using IRQ router VIA [1106/0586] at 00:07.0
Activating ISA DMA hang workarounds.
Linux NET4.0 for Linux 2.4
Based upon Swansea University Computer Society NET3.039 Initializing RT netlink socket
Starting kswapd
VFS: Diskquotas version dquot_6.4.0 initialized
Journalled Block Device driver loaded
ACPI: Core Subsystem version [20011018]
ACPI: Subsystem enabled
pty: 512 Unix98 ptys configured
Uniform Multi-Platform E-IDE driver Revision: 6.31
ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xxVP_IDE: IDE controller on PCI bus 00 dev 39VP_IDE: chipset revision 6VP_IDE: not 100% native mode: will probe irqs later
ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xxVP_IDE: VIA vt82c586b (rev 41) IDE UDMA33 controller on pci00:07.1
ide0: BM-DMA at 0xb400-0xb407, BIOS settings: hda:DMA, hdb:DMA
ide1: BM-DMA at 0xb408-0xb40f, BIOS settings: hdc:DMA, hdd:DMAhda: WDC WD102BA, ATA DISK drive
hdc: CREATIVEDVD8400E, ATAPI CD/DVD-ROM drive
ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
ide1 at 0x170-0x177,0x376 on irq 15
blk: queue c0283aa4, I/O limit 4095Mb (mask 0xffffffff)
hda: 20028960 sectors (10255 MB) w/1961KiB Cache, CHS=1246/255/63, UDMA(33) Partition check:
hda:<7>ldm_validate_partition_table(): Found an MS-DOS partition table, not
a dynamic disk.
hda1 hda2
NET4: Linux TCP/IP 1.0 for NET4.0
IP Protocols: ICMP, UDP, TCP, IGMP
IP: routing cache hash table of 512 buckets, 4Kbytes
TCP: Hash tables configured (established 8192 bind 8192)
NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.
kjournald starting. Commit interval 5 seconds
EXT3-fs: mounted filesystem with ordered data mode.
VFS: Mounted root (ext3 filesystem) readonly.
Freeing unused kernel memory: 64k freed
Adding Swap: 530104k swap-space (priority -1)
EXT3 FS 2.4-0.9.19, 19 August 2002 on ide0(3,1), internal journal Real Time Clock Driver v1.10e
PCI: Assigned IRQ 5 for device 00:08.0
3c59x: Donald Becker and others. www.scyld.com/network/vortex.html 00:08.0: 3Com PCI 3c905B Cyclone 100baseTx at 0xb800. Vers LK1.1.16 usb.c: registered new driver usbdevfsusb.c: registered new driver hubusb-uhci.c: $Revision: 1.275 $ time 17:41:15 Dec 11 2002 usb-uhci.c: High bandwidth mode enabled
PCI: Assigned IRQ 11 for device 00:07.2usb-uhci.c: USB UHCI at I/O 0xb000, IRQ 11usb-uhci.c: Detected 2 portsusb.c: new USB bus registered, assigned bus number 1hub.c: USB hub foundhub.c: 2 ports detectedusb-uhci.c: v1.275:USB Universal Host Controller Interface driver hub.c: new USB device 00:07.2-2, assigned address 2usb.c: USB device 2 (vend/prod 0x7ab/0xfc01) is not claimed by any active driver.
SCSI subsystem driver Revision: 1.00
Initializing USB Mass Storage driver...usb.c: registered new driver usb-storage
scsi0 : SCSI emulation for USB Mass Storage devices
Vendor: OnStream Model: USB30 Rev: 1.09
Type: Sequential-Access ANSI SCSI revision: 02
WARNING: USB Mass Storage data integrity not assured
USB Mass Storage device found at 2
USB Mass Storage support registered.
osst :I: Tape driver with OnStream support version 0.9.10
osst :I: $Id: osst.c,v 1.65 2001/11/11 20:38:56 riede Exp $
osst :I: Attached OnStream USB30 tape at scsi0, channel 0, id 0, lun 0 as osst0usb-uhci.c: interrupt, status 30, frame# 1939usb-uhci.c: Host controller halted, trying to restart. usb-uhci.c: interrupt, status 2, frame# 1927
freecom reset calledhub.c: already running port 2 disabled by hub (EMI?), re-enabling... usb.c: USB disconnect on device 00:07.2-2 address 2
osst0:W: Warning 70000 (sugg. bt 0x0, driver bt 0x0, host bt 0x7). osst0:I: This warning may be caused by your scsi controller, osst0:I: it has been reported with some Buslogic cards.
osst0:W: Command with sense data: Info fld=0xa00 (nonstd), Current osst:ce:00: sns = 70 2
Raw sense data:0x70 0x00 0x02 0x00 0x00 0x0a 0x00 0x00
osst0:W: Command with sense data: Info fld=0xa00 (nonstd), Current osst:ce:00: sns = 70 2
Raw sense data:0x70 0x00 0x02 0x00 0x00 0x0a 0x00 0x00
osst0:W: Command with sense data: Info fld=0xa00 (nonstd), Current osst:ce:00: sns = 70 2
Raw sense data:0x70 0x00 0x02 0x00 0x00 0x0a 0x00 0x00hub.c: new USB device 00:07.2-2, assigned address 3
WARNING: USB Mass Storage data integrity not assured
USB Mass Storage device found at 3usb-uhci.c: interrupt, status 2, frame# 1403
freecom reset called
osst0:W: Warning 70000 (sugg. bt 0x0, driver bt 0x0, host bt 0x7). freecom reset called
osst0:W: Warning 70000 (sugg. bt 0x0, driver bt 0x0, host bt 0x7). freecom reset called
freecom reset called
freecom reset called
freecom reset called
freecom reset called
osst0:W: Warning 70000 (sugg. bt 0x0, driver bt 0x0, host bt 0x7). hub.c: already running port 2 disabled by hub (EMI?), re-enabling... usb.c: USB disconnect on device 00:07.2-2 address 3
freecom reset called
osst0:W: Command with sense data: Info fld=0xa00 (nonstd), Current osst:ce:00: sns = 70 2
Raw sense data:0x70 0x00 0x02 0x00 0x00 0x0a 0x00 0x00
osst0:W: Command with sense data: Info fld=0xa00 (nonstd), Current osst:ce:00: sns = 70 2
Raw sense data:0x70 0x00 0x02 0x00 0x00 0x0a 0x00 0x00hub.c: new USB device 00:07.2-2, assigned address 4
WARNING: USB Mass Storage data integrity not assured
USB Mass Storage device found at 4usb-uhci.c: interrupt, status 2, frame# 508
freecom reset called
osst0:W: Warning 70000 (sugg. bt 0x0, driver bt 0x0, host bt 0x7). hub.c: already running port 2 disabled by hub (EMI?), re-enabling... usb.c: USB disconnect on device 00:07.2-2 address 4
osst0:W: Command with sense data: Info fld=0xa00 (nonstd), Current osst:ce:00: sns = 70 2
Raw sense data:0x70 0x00 0x02 0x00 0x00 0x0a 0x00 0x00
osst0:W: Command with sense data: Info fld=0xa00 (nonstd), Current osst:ce:00: sns = 70 2
Raw sense data:0x70 0x00 0x02 0x00 0x00 0x0a 0x00 0x00
osst0:W: Command with sense data: Info fld=0xa00 (nonstd), Current osst:ce:00: sns = 70 2
Raw sense data:0x70 0x00 0x02 0x00 0x00 0x0a 0x00 0x00hub.c: new USB device 00:07.2-2, assigned address 5
WARNING: USB Mass Storage data integrity not assured
USB Mass Storage device found at 5usb-uhci.c: interrupt, status 2, frame# 945
freecom reset called
osst0:W: Warning 70000 (sugg. bt 0x0, driver bt 0x0, host bt 0x7). freecom reset called
osst0:W: Warning 70000 (sugg. bt 0x0, driver bt 0x0, host bt 0x7). freecom reset called
freecom reset calledhub.c: already running port 2 disabled by hub (EMI?), re-enabling... usb.c: USB disconnect on device 00:07.2-2 address 5
freecom reset called
osst0:W: Command with sense data: Info fld=0xa00 (nonstd), Current osst:ce:00: sns = 70 2
Raw sense data:0x70 0x00 0x02 0x00 0x00 0x0a 0x00 0x00
osst0:W: Command with sense data: Info fld=0xa00 (nonstd), Current osst:ce:00: sns = 70 2
Raw sense data:0x70 0x00 0x02 0x00 0x00 0x0a 0x00 0x00hub.c: new USB device 00:07.2-2, assigned address 6
WARNING: USB Mass Storage data integrity not assured
USB Mass Storage device found at 6usb-uhci.c: interrupt, status 2, frame# 146
freecom reset called
osst0:W: Warning 70000 (sugg. bt 0x0, driver bt 0x0, host bt 0x7). hub.c: already running port 2 disabled by hub (EMI?), re-enabling... usb.c: USB disconnect on device 00:07.2-2 address 6
osst0:W: Command with sense data: Info fld=0xa00 (nonstd), Current osst:ce:00: sns = 70 2
Raw sense data:0x70 0x00 0x02 0x00 0x00 0x0a 0x00 0x00
osst0:W: Command with sense data: Info fld=0xa00 (nonstd), Current osst:ce:00: sns = 70 2
Raw sense data:0x70 0x00 0x02 0x00 0x00 0x0a 0x00 0x00hub.c: new USB device 00:07.2-2, assigned address 7
WARNING: USB Mass Storage data integrity not assured
USB Mass Storage device found at 7usb-uhci.c: interrupt, status 2, frame# 520
freecom reset called
osst0:W: Warning 70000 (sugg. bt 0x0, driver bt 0x0, host bt 0x7). freecom reset called
osst0:W: Warning 70000 (sugg. bt 0x0, driver bt 0x0, host bt 0x7). freecom reset calledhub.c: already running port 2 disabled by hub (EMI?), re-enabling... usb.c: USB disconnect on device 00:07.2-2 address 7
freecom reset called
osst0:W: Command with sense data: Info fld=0xa00 (nonstd), Current osst:ce:00: sns = 70 2
Raw sense data:0x70 0x00 0x02 0x00 0x00 0x0a 0x00 0x00
osst0:W: Command with sense data: Info fld=0xa00 (nonstd), Current osst:ce:00: sns = 70 2
Raw sense data:0x70 0x00 0x02 0x00 0x00 0x0a 0x00 0x00hub.c: new USB device 00:07.2-2, assigned address 8
WARNING: USB Mass Storage data integrity not assured
USB Mass Storage device found at 8usb-uhci.c: interrupt, status 2, frame# 1808
freecom reset called
osst0:W: Warning 70000 (sugg. bt 0x0, driver bt 0x0, host bt 0x7). hub.c: already running port 2 disabled by hub (EMI?), re-enabling... usb.c: USB disconnect on device 00:07.2-2 address 8
osst0:W: Command with sense data: Info fld=0xa00 (nonstd), Current osst:ce:00: sns = 70 2
Raw sense data:0x70 0x00 0x02 0x00 0x00 0x0a 0x00 0x00
osst0:W: Command with sense data: Info fld=0xa00 (nonstd), Current osst:ce:00: sns = 70 2
Raw sense data:0x70 0x00 0x02 0x00 0x00 0x0a 0x00 0x00
osst0:W: Command with sense data: Info fld=0xa00 (nonstd), Current osst:ce:00: sns = 70 2
Raw sense data:0x70 0x00 0x02 0x00 0x00 0x0a 0x00 0x00hub.c: new USB device 00:07.2-2, assigned address 9
WARNING: USB Mass Storage data integrity not assured
USB Mass Storage device found at 9usb-uhci.c: interrupt, status 2, frame# 1821hub.c: already running port 2 disabled by hub (EMI?), re-enabling... usb.c: USB disconnect on device 00:07.2-2 address 9
freecom reset called
osst0:W: Warning 70000 (sugg. bt 0x0, driver bt 0x0, host bt 0x7). osst0:W: Command with sense data: Info fld=0xa00 (nonstd), Current osst:ce:00: sns = 70 2
Raw sense data:0x70 0x00 0x02 0x00 0x00 0x0a 0x00 0x00
osst0:W: Command with sense data: Info fld=0xa00 (nonstd), Current osst:ce:00: sns = 70 2
Raw sense data:0x70 0x00 0x02 0x00 0x00 0x0a 0x00 0x00
osst0:W: Command with sense data: Info fld=0xa00 (nonstd), Current osst:ce:00: sns = 70 2
Raw sense data:0x70 0x00 0x02 0x00 0x00 0x0a 0x00 0x00hub.c: new USB device 00:07.2-2, assigned address 10
WARNING: USB Mass Storage data integrity not assured
USB Mass Storage device found at 10
Re: Problems with OnStream USB30 Tape drive on the USB ports on a FIC VA-503+ - VIA MVP3 Chipset
Hi,
to me this looks like a general USB or a specific usb-storage (FreeCom) problem. Please send details of your USB setup (lsusb) to the usb-storage developers. See
http://www2.one-eyed-alien.net/~mdharm/linux-usb/
On Sun, Dec 15, 2002 at 08:32:19AM -0500, Linux Kernel Developer wrote:
[...]
Quoted 1 line
CPU: AMD-K6(tm) 3D processor stepping 0c
[...]
Quoted 2 lines
ACPI: Core Subsystem version [20011018]
ACPI: Subsystem enabled
[...]
Quoted 1 line
VP_IDE: VIA vt82c586b (rev 41) IDE UDMA33 controller on pci00:07.1
[...]
Quoted 34 lines
usb.c: registered new driver usbdevfsusb.c: registered new driver hubusb-uhci.c: $Revision: 1.275 $ time 17:41:15 Dec 11 2002usb-uhci.c: High bandwidth mode enabled
PCI: Assigned IRQ 11 for device 00:07.2usb-uhci.c: USB UHCI at I/O0xb000, IRQ 11usb-uhci.c: Detected 2 portsusb.c: new USB bus registered, assigned bus number 1hub.c: USB hub foundhub.c: 2 ports detectedusb-uhci.c: v1.275:USB Universal Host Controller Interface driverhub.c: new USB device 00:07.2-2, assigned address 2usb.c: USB device 2 (vend/prod 0x7ab/0xfc01) is not claimed by any active driver.
SCSI subsystem driver Revision: 1.00
Initializing USB Mass Storage driver...usb.c: registered new driver usb-storage
scsi0 : SCSI emulation for USB Mass Storage devices
Vendor: OnStream Model: USB30 Rev: 1.09
Type: Sequential-Access ANSI SCSI revision: 02
WARNING: USB Mass Storage data integrity not assured
USB Mass Storage device found at 2
USB Mass Storage support registered.
osst :I: Tape driver with OnStream support version 0.9.10 osst :I: $Id: osst.c,v 1.65 2001/11/11 20:38:56 riede Exp $ osst :I: Attached OnStream USB30 tape at scsi0, channel 0, id 0, lun 0 as osst0usb-uhci.c: interrupt, status 30, frame# 1939usb-uhci.c: Host controller halted, trying to restart.usb-uhci.c: interrupt, status 2, frame# 1927
freecom reset calledhub.c: already running port 2 disabled by hub (EMI?), re-enabling...usb.c: USB disconnect on device 00:07.2-2 address 2
osst0:W: Warning 70000 (sugg. bt0x0, driver bt0x0, host bt0x7).
Quoted 8 lines
osst0:I: This warning may be caused by your scsi controller, osst0:I: it has been reported with some Buslogic cards. osst0:W: Command with sense data: Info fld=0xa00 (nonstd), Current osst:ce:00: sns = 70 2
Raw sense data:0x700x000x020x000x000x0a0x000x00osst0:W: Command with sense data: Info fld=0xa00 (nonstd), Current osst:ce:00: sns = 70 2
Raw sense data:0x700x000x020x000x000x0a0x000x00
[...]
Regards,
Signature · 3 lines
Kurt Garloff <[email protected]> Eindhoven, NL GPG key: See mail header, key servers SuSE Labs SuSE Linux AG, Nuernberg, DE SCSI, Security
PATCH 1/1 PC-9800 addtional for 2.5.50-ac1 (17/21)
In reply to Osamu TomitaNEC PC-9800 subarchitecture support patch for 2.5.50-ac1 (17/21) This is patch for IRQ number differences in pcmcia driver.
diffstat:
drivers/pcmcia/i82365.c | 4 ++++ 1 files changed, 4 insertions(+)
Regards,
Osamu Tomita
drivers/pcmcia/i82365.c +4 -0
@@ -187,7 +187,11 @@ };/* Default ISA interrupt mask */ +#ifndef CONFIG_PC9800 #define I365_MASK 0xdeb8/* irq 15,14,12,11,10,9,7,5,4,3 */ +#else +#define I365_MASK 0xd668/* irq 15,14,12,10,9,6,5,3 */ +#endif #ifdef CONFIG_ISA static int grab_irq;
PATCH 1/1 PC-9800 addtional for 2.5.50-ac1 (18/21)
In reply to Osamu TomitaNEC PC-9800 subarchitecture support patch for 2.5.50-ac1 (18/21) This is support for C-Bus (legacy bus like ISA) PNP.
drivers/pnp/isapnp/core.c | 5 +++++ 1 files changed, 5 insertions(+)
Regards,
Osamu Tomita
drivers/pnp/isapnp/core.c +5 -0
@@ -76,8 +76,13 @@MODULE_PARM_DESC (isapnp_verbose,"ISA Plug & Play verbose mode" );MODULE_LICENSE ("GPL" ); +#ifndef CONFIG_PC9800 #define _PIDXR 0x279#define _PNPWRP 0xa79 +#else +#define _PIDXR 0x259 +#define _PNPWRP 0xa59 +#endif /* short tags */ #define _STAG_PNPVERNO 0x01
PATCH 1/1 PC-9800 addtional for 2.5.50-ac1 (19/21)
In reply to Osamu TomitaNEC PC-9800 subarchitecture support patch for 2.5.50-ac1 (19/21) This patch is for SCSI driver.
I separate scsicam98.c from scsicam.c and do some cleanup.
diffstat:
drivers/scsi/Kconfig | 7 + drivers/scsi/Makefile | 10 + drivers/scsi/pc980155.c | 263 ++++++++++++++++++++++++++++++++++++++++++++ drivers/scsi/pc980155.h | 47 +++++++ drivers/scsi/pc980155regs.h | 89 ++++++++++++++ drivers/scsi/scsi_scan.c | 1 drivers/scsi/scsi_syms.c | 4 drivers/scsi/scsicam98.c | 192 ++++++++++++++++++++++++++++++++ drivers/scsi/sd.c | 24 +++- drivers/scsi/wd33c93.c | 57 ++++++--- drivers/scsi/wd33c93.h | 5 11 files changed, 677 insertions(+), 22 deletions(-)
Regards,
Osamu Tomita
drivers/scsi/Kconfig +7 -0
@@ -1729,6 +1729,13 @@ see the picture at <http://amiga.multigraph.com/photos/oktagon.html>. +config SCSI_PC980155 + tristate "NEC PC-9801-55 SCSI support" + depends on PC9800 && SCSI + help + If you have the NEC PC-9801-55 SCSI interface card or compatibles + for NEC PC-9801/PC-9821, say Y. + # bool 'Cyberstorm Mk III SCSI support (EXPERIMENTAL)' CONFIG_CYBERSTORMIII_SCSI # bool 'GVP Turbo 040/060 SCSI support (EXPERIMENTAL)' CONFIG_GVP_TURBO_SCSI endmenu
drivers/scsi/Makefile +9 -1
@@ -31,6 +31,7 @@ obj-$(CONFIG_A3000_SCSI) += a3000.o wd33c93.o obj-$(CONFIG_A2091_SCSI) += a2091.o wd33c93.o obj-$(CONFIG_GVP11_SCSI) += gvp11.o wd33c93.o +obj-$(CONFIG_SCSI_PC980155) += pc980155.o wd33c93.o obj-$(CONFIG_MVME147_SCSI) += mvme147.o wd33c93.o obj-$(CONFIG_SGIWD93_SCSI) += sgiwd93.o wd33c93.o obj-$(CONFIG_CYBERSTORM_SCSI) += NCR53C9x.o cyberstorm.o
@@ -122,9 +123,16 @@ obj-$(CONFIG_BLK_DEV_SR) += sr_mod.o obj-$(CONFIG_CHR_DEV_SG) += sg.o -scsi_mod-objs := scsi.o hosts.o scsi_ioctl.o constants.o scsicam.o \ +scsi_mod-objs := scsi.o hosts.o scsi_ioctl.o constants.o \ scsi_error.o scsi_lib.o scsi_scan.o scsi_syms.o +ifneq ($(CONFIG_PC9800),y) +scsi_mod-objs += scsicam.o +else +export-objs += wd33c93.o +scsi_mod-objs += scsicam98.o +endif + ifdef CONFIG_PROC_FS scsi_mod-objs += scsi_proc.o endif
drivers/scsi/pc980155.c +263 -0
263 lines not on this page · raw message
drivers/scsi/pc980155.h +47 -0
47 lines not on this page · raw message
drivers/scsi/pc980155regs.h +89 -0
89 lines not on this page · raw message
drivers/scsi/scsi_scan.c +1 -0
@@ -129,6 +129,7 @@ {"MITSUMI", "CD-R CR-2201CS", "6119", BLIST_NOLUN}, /* locks up */ {"RELISYS", "Scorpio", NULL, BLIST_NOLUN}, /* responds to all lun */ {"MICROTEK", "ScanMaker II", "5.61", BLIST_NOLUN}, /* responds to all lun */ + {"NEC", "D3856", "0009", BLIST_NOLUN},/* * Other types of devices that have special flags.
drivers/scsi/scsi_syms.c +4 -0
@@ -95,6 +95,10 @@EXPORT_SYMBOL (scsi_host_put);EXPORT_SYMBOL (scsi_device_types); +/* For PC-9800 architecture support */ +extern struct scsi_device *sd_find_params_by_bdev (struct block_device *,char **,sector_t *); +EXPORT_SYMBOL (sd_find_params_by_bdev); +/* * Externalize timers so that HBAs can safely start/restart commands. */
drivers/scsi/scsicam98.c +192 -0
192 lines not on this page · raw message
drivers/scsi/sd.c +23 -1
@@ -195,6 +195,7 @@case HDIO_GETGEO :/* Return BIOS disk parameters */ {struct hd_geometry *loc = (struct hd_geometry *)arg; +extern int pc98;if (!loc)return -EINVAL ;
@@ -210,7 +211,7 @@/* override with calculated, extended default, or driver values */ -if (host->hostt->bios_param) { +if (!pc98 && host->hostt->bios_param) { host->hostt->bios_param (sdp, bdev, capacity, diskinfo); }else
@@ -1297,6 +1298,27 @@kfree (sdkp); } +struct scsi_device *sd_find_params_by_bdev (struct block_device *bdev,char **disk_name,sector_t *capacity) +{ +struct scsi_disk *sdkp; +int major =major (to_kdev_t (bdev->bd_dev)); + +spin_lock (&sd_devlist_lock); +list_for_each_entry (sdkp, &sd_devlist, list) { +if (sdkp->disk->major == major) { +if (capacity) + *capacity = sdkp->capacity; +if (disk_name) + *disk_name = sdkp->disk->disk_name; +spin_unlock (&sd_devlist_lock); +return sdkp->device; + } + } + +spin_unlock (&sd_devlist_lock); +return NULL ; +} +/** * init_sd - entry point for this driver (both when built in or when * a module).
drivers/scsi/wd33c93.c +37 -20
177 lines not on this page · raw message
drivers/scsi/wd33c93.h +5 -0
@@ -186,8 +186,13 @@/* This is what the 3393 chip looks like to us */ typedef struct { +#if defined(CONFIG_SCSI_PC980155 ) || defined(CONFIG_SCSI_PC980155_MODULE ) +volatile unsigned int *SASR; +volatile unsigned int *SCMD; +#else volatile unsigned char *SASR;volatile unsigned char *SCMD; +#endif }wd33c93_regs ;
PATCH 1/1 PC-9800 addtional for 2.5.50-ac1 (20/21)
In reply to Osamu TomitaNEC PC-9800 subarchitecture support patch for 2.5.50-ac1 (20/21) This patch support on-board modem of PC98.
diffstat:
drivers/serial/8250_pnp.c | 5 +++++ 1 files changed, 5 insertions(+)
Regards,
Osamu Tomita
drivers/serial/8250_pnp.c +5 -0
@@ -188,6 +188,8 @@ { "MVX00A1", 0 },/* PC Rider K56 Phone System PnP */ { "MVX00F2", 0 }, +/* NEC 98NOTE SPEAKER PHONE FAX MODEM(33600bps) */ + { "nEC8241", 0 },/* Pace 56 Voice Internal Plug & Play Modem */ { "PMC2430", 0 },/* Generic */
@@ -373,6 +375,9 @@ ((port->min ==0x2f8 ) || (port->min ==0x3f8 ) || (port->min ==0x2e8 ) || +#ifdef CONFIG_PC9800 + (port->min ==0x8b0 ) || +#endif (port->min == 0x3e8))) return 0; }
PATCH 1/1 PC-9800 addtional for 2.5.50-ac1 (21/21)
In reply to Osamu TomitaNEC PC-9800 subarchitecture support patch for 2.5.50-ac1 (21/21) This patch contains SMP support for PC98 (remained).
arch/i386/kernel/mpparse.c | 45 ++++++++++++++++++++++++++++++++++++--------- arch/i386/kernel/smpboot.c | 14 ++++++++++++++ include/asm-i386/smpboot.h | 9 +++++++++ 3 files changed, 59 insertions(+), 9 deletions(-)
Regards,
Osamu Tomita
arch/i386/kernel/mpparse.c +36 -9
@@ -676,11 +676,14 @@printk (KERN_DEBUG "Default MP configuration #%d\n" , mpf->mpf_feature1);construct_default_ISA_mptable (mpf->mpf_feature1); }else if (mpf->mpf_physptr) { +extern int pc98; +/* * Read the physical hardware table. Anything here will * override the defaults. */ -if (!smp_read_mpc ((void *)mpf->mpf_physptr)) { +if (!smp_read_mpc (pc98 ?phys_to_virt (mpf->mpf_physptr) + : (void *)mpf->mpf_physptr)) { smp_found_config =0 ;printk (KERN_ERR "BIOS bug, MP table errors detected!...\n" );printk (KERN_ERR "... disabling SMP support. (tell your hw vendor)\n" );
@@ -734,8 +737,30 @@Dprintk ("found SMP MP-table at %08lx\n" ,virt_to_phys (mpf));reserve_bootmem (virt_to_phys (mpf),PAGE_SIZE ); +#ifndef CONFIG_PC9800 if (mpf->mpf_physptr)reserve_bootmem (mpf->mpf_physptr,PAGE_SIZE ); +#else +/* +* PC-9800's MPC table places on the very last of +* physical memory; so that simply reserving PAGE_SIZE +* from mpg->mpf_physptr yields BUG() in +* reserve_bootmem. +*/ +if (mpf->mpf_physptr) { +/* +* We cannot access to MPC table to compute +* table size yet, as only few megabytes from +* the bottom is mapped now. +*/ +unsigned long size =PAGE_SIZE ; +unsigned long end = max_low_pfn *PAGE_SIZE ; +if (mpf->mpf_physptr + size > end) + size = end - mpf->mpf_physptr; +reserve_bootmem (mpf->mpf_physptr, size); + } +#endif + mpf_found = mpf;return 1 ; }
@@ -747,8 +772,6 @@void __init find_smp_config (void ) { -unsigned int address; -/* * FIXME: Linux assumes you have 640K of base ram.. * this continues the error...
@@ -778,12 +801,16 @@* MP1.4 SPEC states to only scan first 1K of 4K EBDA. */ - address = *(unsigned short *)phys_to_virt (0x40E ); - address <<=4 ; -smp_scan_config (address,0x400 ); -/* This has been safe for ages */ -if (smp_found_config) -Dprintk (KERN_WARNING "WARNING: MP table in the EBDA can be UNSAFE, contact [email protected] if you experience SMP problems!\n" ); +#ifndef CONFIG_PC9800 /* PC-9800 has no EBDA area? */ + { +unsigned int address = *(unsigned short *)phys_to_virt (0x40E ); + address <<=4 ; +smp_scan_config (address,0x400 ); +/* This has been safe for ages */ +if (smp_found_config) +Dprintk (KERN_WARNING "WARNING: MP table in the EBDA can be UNSAFE, contact [email protected] if you experience SMP problems!\n" ); + } +#endif }
arch/i386/kernel/smpboot.c +14 -0
@@ -856,13 +856,27 @@ nmi_low = *((volatile unsigned short *)TRAMPOLINE_LOW ); } +#ifndef CONFIG_PC9800 CMOS_WRITE (0xa ,0xf ); +#else +/* reset code is stored in 8255 on PC-9800. */ +outb (0x0e ,0x37 );/* SHUT0 = 0 */ +#endif local_flush_tlb ();Dprintk ("1.\n" ); *((volatile unsigned short *)TRAMPOLINE_HIGH ) = start_eip >>4 ;Dprintk ("2.\n" ); *((volatile unsigned short *)TRAMPOLINE_LOW ) = start_eip &0xf ;Dprintk ("3.\n" ); +#ifdef CONFIG_PC9800 +/* +* On PC-9800, continuation on warm reset is done by loading +* %ss:%sp from 0x0000:0404 and executing 'lret', so: +*/ +/* 0x3f0 is on unused interrupt vector and should be safe... */ + *((volatile unsigned long *)phys_to_virt (0x404 )) =0x000003f0 ; +Dprintk ("4.\n" ); +#endif /* * Be paranoid about clearing APIC errors.
include/asm-i386/smpboot.h +9 -0
@@ -13,8 +13,17 @@#define TRAMPOLINE_LOW phys_to_virt(0x8)#define TRAMPOLINE_HIGH phys_to_virt(0xa)#else /* !CONFIG_CLUSTERED_APIC */ +#ifndef CONFIG_PC9800 #define TRAMPOLINE_LOW phys_to_virt(0x467)#define TRAMPOLINE_HIGH phys_to_virt(0x469) +#else /* CONFIG_PC9800 */ +/* +* On PC-9800, continuation on warm reset is done by loading +* %ss:%sp from 0x0000:0404 and executing 'lret', so: +*/ +#define TRAMPOLINE_LOW phys_to_virt(0x4fa) +#define TRAMPOLINE_HIGH phys_to_virt(0x4fc) +#endif /* !CONFIG_PC9800 */ #endif /* CONFIG_CLUSTERED_APIC */ #ifdef CONFIG_CLUSTERED_APIC
Re: [PATCHSET] PC-9800 addtional for 2.5.50-ac1 (21/21)
In article <[email protected]> (at Sun, 15 Dec 2002 22:20:15 +0900), Osamu Tomita <[email protected]> says:
Quoted 14 lines
arch/i386/kernel/mpparse.c +12
-0+#ifndef CONFIG_PC9800 if (mpf->mpf_physptr)reserve_bootmem (mpf->mpf_physptr,PAGE_SIZE ); +#else +/* +* PC-9800's MPC table places on the very last of +* physical memory; so that simply reserving PAGE_SIZE +* from mpg->mpf_physptr yields BUG() in +* reserve_bootmem. +*/ +if (mpf->mpf_physptr) { +/* +* We cannot access to MPC table to compute +* table size yet, as only few megabytes from
arch/i386/kernel/mpparse.c line 763
Quoted 10 lines
arch/i386/kernel/mpparse.c +10
-0+* the bottom is mapped now. +*/ +unsigned long size =PAGE_SIZE ; +unsigned long end = max_low_pfn *PAGE_SIZE ; +if (mpf->mpf_physptr + size > end) + size = end - mpf->mpf_physptr; + reserve_bootmem(mpf->mpf_physptr, size); + } +#endif +
I'm not sure if we need this #ifdef;
it doesn't seem that this #ifdef CONFIG_PC9800 part is harmful for others at all.
Well, if it is required, I prefer putting #ifdef..#endif inside the if-clause like this:
if (mpf->mpf_physptr) {
unsigned long size = PAGE_SIZE;#ifdef CONFIG_PC9800
/*
* PC-9800's MPC table places on the very last of
* physical memory; so that simply reserving PAGE_SIZE
* from mpg->mpf_physptr yields BUG() in
* reserve_bootmem.
*
* We cannot access to MPC table to compute
* table size yet, as only few megabytes from
* the bottom is mapped now.
*/
unsigned long end = max_low_pfn * PAGE_SIZE;
if (mpf->mpf_physptr + size > end)
size = end - mpf->mpf_physptr;
#endif reserve_bootmem(mpf->mpf_physptr, size); }
Signature · 2 lines
Hideaki YOSHIFUJI @ USAGI Project <[email protected]> GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA
Re: [PATCHSET] PC-9800 addtional for 2.5.50-ac1 (21/21)
Quoted 50 lines · YOSHIFUJI Hideaki / 吉藤英明
In article <[email protected]> (at Sun, 15 Dec 2002 22:20:15 +0900), Osamu Tomita <[email protected]> says:
Quoted 14 lines
(quoted diff) +12
-0+#ifndef CONFIG_PC9800 if (mpf->mpf_physptr) reserve_bootmem(mpf->mpf_physptr, PAGE_SIZE); +#else + /* + * PC-9800's MPC table places on the very last of + * physical memory; so that simply reserving PAGE_SIZE + * from mpg->mpf_physptr yields BUG() in + * reserve_bootmem. + */ + if (mpf->mpf_physptr) { + /* + * We cannot access to MPC table to compute + * table size yet, as only few megabytes fromReview
Quoted 10 lines
(quoted diff) +10
-0+ * the bottom is mapped now. + */ + unsigned long size = PAGE_SIZE; + unsigned long end = max_low_pfn * PAGE_SIZE; + if (mpf->mpf_physptr + size > end) + size = end - mpf->mpf_physptr; + reserve_bootmem(mpf->mpf_physptr, size); + } +#endif +I'm not sure if we need this #ifdef;
it doesn't seem that this #ifdefCONFIG_PC9800part is harmful for others at all.Well, if it is required, I prefer putting #ifdef..#endif inside the if-clause like this:
if (mpf->mpf_physptr) { unsigned long size = PAGE_SIZE;#ifdef
CONFIG_PC9800
/*
* PC-9800's MPC table places on the very last of
* physical memory; so that simply reservingPAGE_SIZE
* frommpg->mpf_physptryieldsBUG()in
*reserve_bootmem.
*
* We cannot access to MPC table to compute
* table size yet, as only few megabytes from
* the bottom is mapped now.
*/
unsigned long end =max_low_pfn*PAGE_SIZE;
Quoted 6 lines
if (
mpf->mpf_physptr+ size > end)
size = end -mpf->mpf_physptr;#endif reserve_bootmem(mpf->mpf_physptr, size); }
Thanks for your advice!
Indeed, No need "#ifdef" here.
Because there is a check by "if (mpf->mpf_physptr + size > end)". I rewrite patch. Please comment.
Signature · 1 line
Osamu Tomita
arch/i386/kernel/mpparse.c +30 -10
@@ -73,6 +73,8 @@int summit_x86 =0 ;u8 raw_phys_apicid[NR_CPUS ] = { [0 ...NR_CPUS -1 ] =BAD_APICID }; +extern int pc98;/* NEC PC-9800 subarchitecture or not */ +/* * Intel MP BIOS table parsing routines: */
@@ -683,7 +685,8 @@* Read the physical hardware table. Anything here will * override the defaults. */ -if (!smp_read_mpc ((void *)mpf->mpf_physptr)) { +if (!smp_read_mpc (pc98 ?phys_to_virt (mpf->mpf_physptr) + : (void *)mpf->mpf_physptr)) { smp_found_config =0 ;printk (KERN_ERR "BIOS bug, MP table errors detected!...\n" );printk (KERN_ERR "... disabling SMP support. (tell your hw vendor)\n" );
@@ -737,8 +740,25 @@printk ("found SMP MP-table at %08lx\n" ,virt_to_phys (mpf));reserve_bootmem (virt_to_phys (mpf),PAGE_SIZE ); -if (mpf->mpf_physptr) -reserve_bootmem (mpf->mpf_physptr,PAGE_SIZE ); +/* +* PC-9800's MPC table places on the very last of +* physical memory; so that simply reserving PAGE_SIZE +* from mpg->mpf_physptr yields BUG() in +* reserve_bootmem. +*/ +if (mpf->mpf_physptr) { +/* +* We cannot access to MPC table to compute +* table size yet, as only few megabytes from +* the bottom is mapped now. +*/ +unsigned long size =PAGE_SIZE ; +unsigned long end = max_low_pfn *PAGE_SIZE ; +if (mpf->mpf_physptr + size > end) + size = end - mpf->mpf_physptr; +reserve_bootmem (mpf->mpf_physptr, size); + } + mpf_found = mpf;return 1 ; }
@@ -750,8 +770,6 @@void __init find_smp_config (void ) { -unsigned int address; -/* * FIXME: Linux assumes you have 640K of base ram.. * this continues the error...
@@ -781,11 +799,13 @@* MP1.4 SPEC states to only scan first 1K of 4K EBDA. */ - address = *(unsigned short *)phys_to_virt (0x40E ); - address <<=4 ; -smp_scan_config (address,0x400 ); -if (smp_found_config) -printk (KERN_WARNING "WARNING: MP table in the EBDA can be UNSAFE, contact [email protected] if you experience SMP problems!\n" ); +if (!pc98) {/* PC-9800 has no EBDA area? */ +unsigned int address = *(unsigned short *)phys_to_virt (0x40E ); + address <<=4 ; +smp_scan_config (address,0x400 ); +if (smp_found_config) +printk (KERN_WARNING "WARNING: MP table in the EBDA can be UNSAFE, contact [email protected] if you experience SMP problems!\n" ); + } }
arch/i386/kernel/smpboot.c +14 -0
@@ -823,13 +823,27 @@ nmi_low = *((volatile unsigned short *)TRAMPOLINE_LOW ); } +#ifndef CONFIG_PC9800 CMOS_WRITE (0xa ,0xf ); +#else +/* reset code is stored in 8255 on PC-9800. */ +outb (0x0e ,0x37 );/* SHUT0 = 0 */ +#endif local_flush_tlb ();Dprintk ("1.\n" ); *((volatile unsigned short *)TRAMPOLINE_HIGH ) = start_eip >>4 ;Dprintk ("2.\n" ); *((volatile unsigned short *)TRAMPOLINE_LOW ) = start_eip &0xf ;Dprintk ("3.\n" ); +#ifdef CONFIG_PC9800 +/* +* On PC-9800, continuation on warm reset is done by loading +* %ss:%sp from 0x0000:0404 and executing 'lret', so: +*/ +/* 0x3f0 is on unused interrupt vector and should be safe... */ + *((volatile unsigned long *)phys_to_virt (0x404 )) =0x000003f0 ; +Dprintk ("4.\n" ); +#endif /* * Be paranoid about clearing APIC errors.
include/asm-i386/smpboot.h +9 -0
@@ -13,8 +13,17 @@#define TRAMPOLINE_LOW phys_to_virt(0x8)#define TRAMPOLINE_HIGH phys_to_virt(0xa)#else /* !CONFIG_CLUSTERED_APIC */ +#ifndef CONFIG_PC9800 #define TRAMPOLINE_LOW phys_to_virt(0x467)#define TRAMPOLINE_HIGH phys_to_virt(0x469) +#else /* CONFIG_PC9800 */ +/* +* On PC-9800, continuation on warm reset is done by loading +* %ss:%sp from 0x0000:0404 and executing 'lret', so: +*/ +#define TRAMPOLINE_LOW phys_to_virt(0x4fa) +#define TRAMPOLINE_HIGH phys_to_virt(0x4fc) +#endif /* !CONFIG_PC9800 */ #endif /* CONFIG_CLUSTERED_APIC */ #ifdef CONFIG_CLUSTERED_APIC
Re: [PATCHSET] PC-9800 addtional for 2.5.50-ac1 (21/21)
Any chance of moving the EBDA to query to be something like
unsigned long get_bios_ebda(void)
and hiding it in the per platform includes (returning 0 for non I guess)
Re: [PATCHSET] PC-9800 addtional for 2.5.50-ac1 (21/21)
Thanks for your advice.
Quoted 6 lines · Alan Cox
Any chance of moving the EBDA to query to be something like
unsigned long
get_bios_ebda(void)and hiding it in the per platform includes (returning 0 for non I guess)
How about this patch? This is replace of previous smp.patch.
diffstat:
arch/i386/kernel/mpparse.c | 39 +++++++++++++++++++++++-------------- arch/i386/kernel/smpboot.c | 14 +++++++++++++ arch/i386/mach-defaults/smp_bios.h | 14 +++++++++++++ arch/i386/mach-pc9800/smp_bios.h | 7 ++++++ include/asm-i386/smpboot.h | 9 ++++++++ 5 files changed, 69 insertions(+), 14 deletions(-)
Regards,
Osamu
arch/i386/kernel/mpparse.c +25 -14
@@ -31,9 +31,7 @@#include <asm/pgalloc.h> #include <asm/io_apic.h> #include "mach_apic.h" - -/* Have we found an MP table */ -int smp_found_config; +#include "smp_bios.h" /* * Various Linux-internal data structures created from the
@@ -676,11 +674,14 @@printk (KERN_DEBUG "Default MP configuration #%d\n" , mpf->mpf_feature1);construct_default_ISA_mptable (mpf->mpf_feature1); }else if (mpf->mpf_physptr) { +extern int pc98; +/* * Read the physical hardware table. Anything here will * override the defaults. */ -if (!smp_read_mpc ((void *)mpf->mpf_physptr)) { +if (!smp_read_mpc (pc98 ?phys_to_virt (mpf->mpf_physptr) + : (void *)mpf->mpf_physptr)) { smp_found_config =0 ;printk (KERN_ERR "BIOS bug, MP table errors detected!...\n" );printk (KERN_ERR "... disabling SMP support. (tell your hw vendor)\n" );
@@ -734,8 +735,25 @@Dprintk ("found SMP MP-table at %08lx\n" ,virt_to_phys (mpf));reserve_bootmem (virt_to_phys (mpf),PAGE_SIZE ); -if (mpf->mpf_physptr) -reserve_bootmem (mpf->mpf_physptr,PAGE_SIZE ); +/* +* PC-9800's MPC table places on the very last of +* physical memory; so that simply reserving PAGE_SIZE +* from mpg->mpf_physptr yields BUG() in +* reserve_bootmem. +*/ +if (mpf->mpf_physptr) { +/* +* We cannot access to MPC table to compute +* table size yet, as only few megabytes from +* the bottom is mapped now. +*/ +unsigned long size =PAGE_SIZE ; +unsigned long end = max_low_pfn *PAGE_SIZE ; +if (mpf->mpf_physptr + size > end) + size = end - mpf->mpf_physptr; +reserve_bootmem (mpf->mpf_physptr, size); + } + mpf_found = mpf;return 1 ; }
@@ -747,8 +765,6 @@void __init find_smp_config (void ) { -unsigned int address; -/* * FIXME: Linux assumes you have 640K of base ram.. * this continues the error...
@@ -778,12 +794,7 @@* MP1.4 SPEC states to only scan first 1K of 4K EBDA. */ - address = *(unsigned short *)phys_to_virt (0x40E ); - address <<=4 ; -smp_scan_config (address,0x400 ); -/* This has been safe for ages */ -if (smp_found_config) -Dprintk (KERN_WARNING "WARNING: MP table in the EBDA can be UNSAFE, contact [email protected] if you experience SMP problems!\n" ); +get_bios_ebda (); }
arch/i386/mach-defaults/smp_bios.h +14 -0
@@ -0,0 +1,14 @@ +static int __init smp_scan_config (unsigned long base,unsigned long length); + +/* Have we found an MP table */ +int smp_found_config; + +static inline void get_bios_ebda (void ) +{ +unsigned int address = *(unsigned short *)phys_to_virt (0x40E ); + address <<=4 ; +smp_scan_config (address,0x400 ); +/* This has been safe for ages */ +if (smp_found_config) +Dprintk (KERN_WARNING "WARNING: MP table in the EBDA can be UNSAFE, contact [email protected] if you experience SMP problems!\n" ); +}
arch/i386/mach-pc9800/smp_bios.h +7 -0
@@ -0,0 +1,7 @@ +/* Have we found an MP table */ +int smp_found_config; + +static inline void get_bios_ebda (void ) +{ +/* PC-9800 has no EBDA */ +}
arch/i386/kernel/smpboot.c +14 -0
@@ -823,13 +823,27 @@ nmi_low = *((volatile unsigned short *)TRAMPOLINE_LOW ); } +#ifndef CONFIG_PC9800 CMOS_WRITE (0xa ,0xf ); +#else +/* reset code is stored in 8255 on PC-9800. */ +outb (0x0e ,0x37 );/* SHUT0 = 0 */ +#endif local_flush_tlb ();Dprintk ("1.\n" ); *((volatile unsigned short *)TRAMPOLINE_HIGH ) = start_eip >>4 ;Dprintk ("2.\n" ); *((volatile unsigned short *)TRAMPOLINE_LOW ) = start_eip &0xf ;Dprintk ("3.\n" ); +#ifdef CONFIG_PC9800 +/* +* On PC-9800, continuation on warm reset is done by loading +* %ss:%sp from 0x0000:0404 and executing 'lret', so: +*/ +/* 0x3f0 is on unused interrupt vector and should be safe... */ + *((volatile unsigned long *)phys_to_virt (0x404 )) =0x000003f0 ; +Dprintk ("4.\n" ); +#endif /* * Be paranoid about clearing APIC errors.
include/asm-i386/smpboot.h +9 -0
@@ -13,8 +13,17 @@#define TRAMPOLINE_LOW phys_to_virt(0x8)#define TRAMPOLINE_HIGH phys_to_virt(0xa)#else /* !CONFIG_CLUSTERED_APIC */ +#ifndef CONFIG_PC9800 #define TRAMPOLINE_LOW phys_to_virt(0x467)#define TRAMPOLINE_HIGH phys_to_virt(0x469) +#else /* CONFIG_PC9800 */ +/* +* On PC-9800, continuation on warm reset is done by loading +* %ss:%sp from 0x0000:0404 and executing 'lret', so: +*/ +#define TRAMPOLINE_LOW phys_to_virt(0x4fa) +#define TRAMPOLINE_HIGH phys_to_virt(0x4fc) +#endif /* !CONFIG_PC9800 */ #endif /* CONFIG_CLUSTERED_APIC */ #ifdef CONFIG_CLUSTERED_APIC
Re: [PATCHSET] PC-9800 addtional for 2.5.50-ac1 (21/21)
Quoted 1 line · Osamu Tomita
Thanks for your advice.
Slight misunderstanding: I just meant put the
static inline int get_ebda(void)
{
unsigned int address = *(unsigned short *)phys_to_virt(0x40E); address <<= 4;
return address; /* 0 means none */
}
then do
addr = get_ebda();
if(addr)
spm_scan_config(...)
Which actually fixes a bug too - the real PC can have no EBDA (EBDA value of zero) and we shouldnt scan it if so
Re: [PATCHSET] PC-9800 addtional for 2.5.50-ac1 (21/21)
Quoted 9 lines · Alan Cox
Slight misunderstanding: I just meant put the
static inline int
get_ebda(void){ unsigned int address = *(unsigned short *)phys_to_virt(0x40E); address <<= 4; return address; /* 0 means none */ }
Quoted 8 lines
then do
addr =
get_ebda();
if(addr)spm_scan_config(...)Which actually fixes a bug too - the real PC can have no EBDA (EBDA value of zero) and we shouldnt scan it if so
Oh, I see. Here is a patch rewrited.
Thanks,
Osamu
arch/i386/kernel/mpparse.c +32 -9
@@ -31,6 +31,7 @@#include <asm/pgalloc.h> #include <asm/io_apic.h> #include "mach_apic.h" +#include "bios_ebda.h" /* Have we found an MP table */ int smp_found_config;
@@ -676,11 +677,14 @@printk (KERN_DEBUG "Default MP configuration #%d\n" , mpf->mpf_feature1);construct_default_ISA_mptable (mpf->mpf_feature1); }else if (mpf->mpf_physptr) { +extern int pc98; +/* * Read the physical hardware table. Anything here will * override the defaults. */ -if (!smp_read_mpc ((void *)mpf->mpf_physptr)) { +if (!smp_read_mpc (pc98 ?phys_to_virt (mpf->mpf_physptr) + : (void *)mpf->mpf_physptr)) { smp_found_config =0 ;printk (KERN_ERR "BIOS bug, MP table errors detected!...\n" );printk (KERN_ERR "... disabling SMP support. (tell your hw vendor)\n" );
@@ -734,8 +738,25 @@Dprintk ("found SMP MP-table at %08lx\n" ,virt_to_phys (mpf));reserve_bootmem (virt_to_phys (mpf),PAGE_SIZE ); -if (mpf->mpf_physptr) -reserve_bootmem (mpf->mpf_physptr,PAGE_SIZE ); +/* +* PC-9800's MPC table places on the very last of +* physical memory; so that simply reserving PAGE_SIZE +* from mpg->mpf_physptr yields BUG() in +* reserve_bootmem. +*/ +if (mpf->mpf_physptr) { +/* +* We cannot access to MPC table to compute +* table size yet, as only few megabytes from +* the bottom is mapped now. +*/ +unsigned long size =PAGE_SIZE ; +unsigned long end = max_low_pfn *PAGE_SIZE ; +if (mpf->mpf_physptr + size > end) + size = end - mpf->mpf_physptr; +reserve_bootmem (mpf->mpf_physptr, size); + } + mpf_found = mpf;return 1 ; }
@@ -778,12 +799,14 @@* MP1.4 SPEC states to only scan first 1K of 4K EBDA. */ - address = *(unsigned short *)phys_to_virt (0x40E ); - address <<=4 ; -smp_scan_config (address,0x400 ); -/* This has been safe for ages */ -if (smp_found_config) -Dprintk (KERN_WARNING "WARNING: MP table in the EBDA can be UNSAFE, contact [email protected] if you experience SMP problems!\n" ); + address =get_bios_ebda (); +if (address) + { +smp_scan_config (address,0x400 ); +/* This has been safe for ages */ +if (smp_found_config) +Dprintk (KERN_WARNING "WARNING: MP table in the EBDA can be UNSAFE, contact [email protected] if you experience SMP problems!\n" ); + } }
arch/i386/mach-defaults/bios_ebda.h +15 -0
@@ -0,0 +1,15 @@ +#ifndef _MACH_BIOS_EBDA_H +#define _MACH_BIOS_EBDA_H + +/* +* there is a real-mode segmented pointer pointing to the +* 4K EBDA area at 0x40E. +*/ +static inline unsigned int get_bios_ebda (void ) +{ +unsigned int address = *(unsigned short *)phys_to_virt (0x40E ); + address <<=4 ; +return address;/* 0 means none */ +} + +#endif /* _MACH_BIOS_EBDA_H */
arch/i386/mach-pc9800/bios_ebda.h +14 -0
@@ -0,0 +1,14 @@ +#ifndef _MACH_BIOS_EBDA_H +#define _MACH_BIOS_EBDA_H + +/* +* PC-9800 has no EBDA. +* Its BIOS uses 0x40E for other purpose, +* Not pointer to 4K EBDA area. +*/ +static inline unsigned int get_bios_ebda (void ) +{ +return 0 ;/* 0 means none */ +} + +#endif /* _MACH_BIOS_EBDA_H */
arch/i386/kernel/smpboot.c +14 -0
@@ -856,13 +856,27 @@ nmi_low = *((volatile unsigned short *)TRAMPOLINE_LOW ); } +#ifndef CONFIG_PC9800 CMOS_WRITE (0xa ,0xf ); +#else +/* reset code is stored in 8255 on PC-9800. */ +outb (0x0e ,0x37 );/* SHUT0 = 0 */ +#endif local_flush_tlb ();Dprintk ("1.\n" ); *((volatile unsigned short *)TRAMPOLINE_HIGH ) = start_eip >>4 ;Dprintk ("2.\n" ); *((volatile unsigned short *)TRAMPOLINE_LOW ) = start_eip &0xf ;Dprintk ("3.\n" ); +#ifdef CONFIG_PC9800 +/* +* On PC-9800, continuation on warm reset is done by loading +* %ss:%sp from 0x0000:0404 and executing 'lret', so: +*/ +/* 0x3f0 is on unused interrupt vector and should be safe... */ + *((volatile unsigned long *)phys_to_virt (0x404 )) =0x000003f0 ; +Dprintk ("4.\n" ); +#endif /* * Be paranoid about clearing APIC errors.
include/asm-i386/smpboot.h +9 -0
@@ -13,8 +13,17 @@#define TRAMPOLINE_LOW phys_to_virt(0x8)#define TRAMPOLINE_HIGH phys_to_virt(0xa)#else /* !CONFIG_CLUSTERED_APIC */ +#ifndef CONFIG_PC9800 #define TRAMPOLINE_LOW phys_to_virt(0x467)#define TRAMPOLINE_HIGH phys_to_virt(0x469) +#else /* CONFIG_PC9800 */ +/* +* On PC-9800, continuation on warm reset is done by loading +* %ss:%sp from 0x0000:0404 and executing 'lret', so: +*/ +#define TRAMPOLINE_LOW phys_to_virt(0x4fa) +#define TRAMPOLINE_HIGH phys_to_virt(0x4fc) +#endif /* !CONFIG_PC9800 */ #endif /* CONFIG_CLUSTERED_APIC */ #ifdef CONFIG_CLUSTERED_APIC
Re: [PATCHSET] PC-9800 addtional for 2.5.50-ac1 (21/21)
Perfect
Quoted 3 lines · Osamu Tomita
NEC PC-9800 subarchitecture support patch updated. This is additional patch for 2.5.50-ac1, containing updates for already merged files and not merged patch.
Thanks - Im rather busy right now with Christmas and RH deadlines approaching, but I'll look once I get some time - the changes look nice, the split of stuff to avoid ifdefs is a lot better
Quoted 1 line · Osamu Tomita
NEC PC-9800 subarchitecture support patch updated.
Hi Osamu, next time can you give the mails sensible names, that makes it a lot easier to pick up whats looks good.
Maybe even a short intro in this summary file.
The splitup looks good btw.
Sam