PC-9800 patch for 2.5.47-ac4: not merged yet (0/15)
Subsystems (13)
Thanks for interest in PC-9800 subarchitecture support. I've made additional patch for 2.5.47-ac4 to support PC-9800 completely. Would you please merge into your tree?
Regards,
Osamu
Signature · 2 lines
Osamu Tomita [email protected]
PC-9800 patch for 2.5.47-ac4: not merged yet (1/15) apm
This is for apm support.
diffstat:
arch/i386/kernel/apm.c | 55 +++++++++++++++++++++++++++++++++++++++++------ include/linux/apm_bios.h | 24 ++++++++++++++++++++ 2 files changed, 72 insertions(+), 7 deletions(-)
Signature · 2 lines
Osamu Tomita [email protected]
arch/i386/kernel/apm.c +48 -7
@@ -227,6 +227,8 @@#include <linux/sysrq.h> +#include "io_ports.h" +extern rwlock_t xtime_lock;extern spinlock_t i8253_lock;extern unsigned long get_cmos_time (void );
@@ -377,6 +379,15 @@#define DEFAULT_IDLE_PERIOD (100 / 3)/* +* PC-9800 BIOS reports version by BCD format +*/ +#ifdef CONFIG_PC9800 +#define BIOS_VERSION_HILO_FMT "%d.%02x" +#else +#define BIOS_VERSION_HILO_FMT "%d.%d" +#endif + +/* * Local variables */ static struct {
@@ -629,6 +640,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 +704,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"
@@ -961,7 +978,7 @@/* * This may be called on an SMP machine. */ -#ifdef CONFIG_SMP +#if defined(CONFIG_SMP ) && !defined(CONFIG_PC9800 )/* Some bioses don't like being called from CPU != 0 */ if (smp_processor_id () !=0 ) {set_cpus_allowed (current,1 <<0 );
@@ -1241,11 +1258,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 }
@@ -1720,7 +1737,8 @@-1: Unknown 8) min = minutes; sec = seconds */ - p += sprintf(p, "%s %d.%d 0x%02x 0x%02x 0x%02x 0x%02x %d%% %d %s\n", + p += sprintf(p, "%s " BIOS_VERSION_HILO_FMT + " 0x%02x 0x%02x 0x%02x 0x%02x %d%% %d %s\n", driver_version, (apm_info.bios.version >> 8) & 0xff, apm_info.bios.version & 0xff,
@@ -1744,6 +1762,8 @@char * power_stat;char * bat_stat; +#if !defined(CONFIG_PC9800 ) || !defined(CONFIG_SMP ) +/* Deamonize causes freeze on PC-9800 SMP box */ kapmd_running =1 ;daemonize ();
@@ -1751,6 +1771,7 @@strcpy (current->comm,"kapmd" ); current->flags |=PF_IOTHREAD ;sigfillset (¤t->blocked); +#endif /* !CONFIG_PC9800 || !CONFIG_SMP */ #ifdef CONFIG_SMP /* 2002/08/01 - WT
@@ -1780,6 +1801,17 @@/* Fall back to an APM 1.0 connection. */ apm_info.connection_version =0x100 ; } +#ifdef CONFIG_PC9800 + else { +printk ("PC-9801 APM BIOS BUG work around: " +"fix connection_version 0x%x to " , + apm_info.connection_version); + apm_info.connection_version = + (apm_info.connection_version &0xff00 ) + | ((apm_info.connection_version &0x00f0 ) >>4 ); +printk ("0x%x\n" , apm_info.connection_version); + } +#endif /* CONFIG_PC9800 */ } }
@@ -1956,8 +1988,8 @@printk (KERN_INFO "apm: BIOS not found.\n" );return -ENODEV ; } - printk(KERN_INFO - "apm: BIOS version %d.%d Flags 0x%02x (Driver version %s)\n", + printk(KERN_INFO "apm: BIOS version " BIOS_VERSION_HILO_FMT + " Flags 0x%02x (Driver version %s)\n", ((apm_info.bios.version >> 8) & 0xff), (apm_info.bios.version & 0xff), apm_info.bios.flags,
@@ -1984,6 +2016,11 @@if (apm_info.bios.version ==0x001 ) apm_info.bios.version =0x100 ; +#ifdef CONFIG_PC9800 +/* In PC-9800, APM BIOS version is written in BCD...?? */ + apm_info.bios.version = (apm_info.bios.version &0xff00 ) + | ((apm_info.bios.version &0x00f0 ) >>4 ); +#endif /* BIOS < 1.2 doesn't set cseg_16_len */ if (apm_info.bios.version <0x102 ) apm_info.bios.cseg_16_len =0 ;/* 64k */
@@ -2067,7 +2104,11 @@if (apm_proc)SET_MODULE_OWNER (apm_proc); +#if defined(CONFIG_PC9800 ) && defined(CONFIG_SMP ) +apm (0 ); +#else kernel_thread (apm,NULL ,CLONE_FS |CLONE_FILES |CLONE_SIGHAND |SIGCHLD ); +#endif if (num_online_cpus () >1 && !smp ) { printk(KERN_NOTICE
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
PC-9800 patch for 2.5.47-ac4: not merged yet (2/15) Core
In reply to Osamu TomitaThis is rest of core patch under arch/i386/.
diffstat:
arch/i386/Kconfig | 24 +++- 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 | 80 +++++++++++++ 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, 994 insertions(+), 292 deletions(-)
Signature · 2 lines
Osamu Tomita [email protected]
arch/i386/Kconfig +22 -2
@@ -995,6 +995,12 @@ # Visual Workstation support is utterly broken. # If you want to see it working mail an VW540 to [email protected] 8) #bool 'SGI Visual Workstation support' CONFIG_VISWS +config PC9800 + bool "NEC PC-9800 architecture support" + 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_VISWS_APIC bool depends on VISWS
@@ -1087,7 +1093,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.
@@ -1103,7 +1109,7 @@ config MCA bool "MCA support" - depends on !VISWS + depends on !(VISWS || PC9800) help MicroChannel Architecture is found in some IBM PS/2 machines and laptops. It is a bus system similar to PCI or ISA. See
@@ -1451,6 +1457,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
@@ -1464,6 +1471,7 @@ config VIDEO_SELECT bool "Video mode selection support" + depends on !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
@@ -1477,6 +1485,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
@@ -49,6 +49,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);
@@ -452,8 +454,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)
@@ -490,7 +491,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
@@ -514,10 +515,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 +80 -0
80 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"
PC-9800 patch for 2.5.47-ac4: not merged yet (3/15) console
In reply to Osamu TomitaThis is for VT console support.
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(-)
Signature · 2 lines
Osamu Tomita [email protected]
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))
PC-9800 patch for 2.5.47-ac4: not merged yet (4/15) net devices
In reply to Osamu TomitaThis is for legacy bus network cards support.
diffstat:
drivers/net/3c509.c | 33 +++ drivers/net/8390.h | 3 drivers/net/Kconfig | 55 ++++- drivers/net/Makefile | 4 drivers/net/Makefile.lib | 1 drivers/net/Space.c | 2 drivers/net/at1700.c | 115 +++++++++- drivers/net/ne.c | 517 +++++++++++++++++++++++++++++++++++++++++++++-- drivers/net/ne2k_cbus.h | 467 ++++++++++++++++++++++++++++++++++++++++++ 9 files changed, 1165 insertions(+), 32 deletions(-)
Signature · 2 lines
Osamu Tomita [email protected]
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"
@@ -170,7 +174,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);
@@ -391,6 +399,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 ))
@@ -405,6 +414,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
@@ -460,7 +470,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 ;
@@ -484,7 +498,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 ) {
@@ -1257,7 +1279,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 +4 -0
@@ -89,7 +89,11 @@ obj-$(CONFIG_ARM_ETHERH) += 8390.o obj-$(CONFIG_WD80x3) += wd.o 8390.o obj-$(CONFIG_EL2) += 3c503.o 8390.o +ifneq ($(CONFIG_PC9800),y) obj-$(CONFIG_NE2000) += ne.o 8390.o +else +obj-$(CONFIG_NE2K_CBUS) += ne.o 8390.o +endif 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 +503 -14
779 lines not on this page · raw message
drivers/net/ne2k_cbus.h +467 -0
467 lines not on this page · raw message
PC-9800 patch for 2.5.47-ac4: not merged yet (5/15) FS
In reply to Osamu TomitaThis is for support PC-9800 specific partition table
and FAT partition made by PC-9800's DOS.
diffstat:
fs/fat/inode.c | 5 fs/partitions/Kconfig | 11 + fs/partitions/Makefile | 1 fs/partitions/check.c | 4 fs/partitions/msdos.c | 15 ++ fs/partitions/nec98.c | 277 +++++++++++++++++++++++++++++++++++++++++++++++++ fs/partitions/nec98.h | 10 + 7 files changed, 322 insertions(+), 1 deletion(-)
Signature · 2 lines
Osamu Tomita [email protected]
fs/fat/inode.c +4 -1
@@ -49,6 +49,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 ) {
@@ -928,7 +929,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 +11 -0
@@ -177,6 +177,17 @@ 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 NEC98_BSD_DISKLABEL + bool "BSD disklabel support for NEC PC-9800 type partitions" + depends on NEC98_PARTITION + 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 +15 -0
@@ -20,6 +20,11 @@*/ #include <linux/config.h> + +#ifdef CONFIG_NEC98_BSD_DISKLABEL +# define CONFIG_BSD_DISKLABEL +#endif +#include <linux/buffer_head.h> /* for invalidate_bdev() */ #ifdef CONFIG_BLK_DEV_IDE
@@ -37,6 +42,7 @@#include "msdos.h" #include "efi.h" +#if !defined(CONFIG_PC9800 ) || defined(CONFIG_MSDOS_PARTITION )/* * Many architectures don't like unaligned accesses, which is * frequently the case with the nr_sects and start_sect partition
@@ -171,6 +177,7 @@ done: put_dev_sector(sect); } +#endif /* !defined(CONFIG_PC9800) || defined(CONFIG_MSDOS_PARTITION) */ /* [email protected]: Solaris has a nasty indicator: 0x82 which also indicates linux swap. Be careful before believing this is Solaris. */
@@ -179,6 +186,7 @@ parse_solaris_x86(struct parsed_partitions *state, struct block_device *bdev, u32 offset, u32 size, int origin) { +#if !defined(CONFIG_PC9800) || defined(CONFIG_MSDOS_PARTITION) #ifdef CONFIG_SOLARIS_X86_PARTITION Sector sect;struct solaris_x86_vtoc *v;
@@ -212,6 +220,7 @@put_dev_sector (sect);printk (" >\n" );#endif +#endif /* !defined(CONFIG_PC9800) || defined(CONFIG_MSDOS_PARTITION) */ }#ifdef CONFIG_BSD_DISKLABEL
@@ -219,7 +228,11 @@* Create devices for BSD partitions listed in a disklabel, under a * dos-like partition. See parse_extended() for more information. */ +#ifndef CONFIG_NEC98_BSD_DISKLABEL static void +#else +void +#endifparse_bsd (struct parsed_partitions *state,struct block_device *bdev,u32 offset,u32 size,int origin,char *flavour,int max_partitions)
@@ -292,6 +305,7 @@#endif } +#if !defined(CONFIG_PC9800 ) || defined(CONFIG_MSDOS_PARTITION )/* * Create devices for Unixware partitions listed in a disklabel, under a * dos-like partition. See parse_extended() for more information.
@@ -461,3 +475,4 @@put_dev_sector (sect); return 1; } +#endif /* !defined(CONFIG_PC9800) || defined(CONFIG_MSDOS_PARTITION) */
fs/partitions/nec98.c +277 -0
277 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);
PC-9800 patch for 2.5.47-ac4: not merged yet (6/15) IDE
In reply to Osamu TomitaThis is for onboard IDE I/F support.
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(-)
Signature · 2 lines
Osamu Tomita [email protected]
drivers/ide/Kconfig +5 -0
@@ -1005,6 +1005,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
@@ -557,7 +562,7 @@if (hwif->mmio ==2 )return 0 ; - addr_errs =hwif_check_region (hwif->io_ports[IDE_DATA_OFFSET ],1 ); + addr_errs =hwif_check_region (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->io_ports[i],1 );if (hwif->io_ports[IDE_CONTROL_OFFSET ])
@@ -606,7 +611,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);
@@ -623,7 +630,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);
@@ -634,6 +641,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) {
@@ -956,7 +966,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,
@@ -966,6 +976,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 @@static 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
@@ -554,7 +559,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 ); } } }
@@ -2019,6 +2025,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 {
PC-9800 patch for 2.5.47-ac4: not merged yet (7/15) Core#2
In reply to Osamu TomitaThis is rest of core part 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(+)
Signature · 2 lines
Osamu Tomita [email protected]
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) * \
PC-9800 patch for 2.5.47-ac4: not merged yet (8/15) input
In reply to Osamu TomitaThis is for PC-9800's standard keyboard and mouse support.
diffstat:
drivers/char/keyboard.c | 4 drivers/input/keyboard/98kbd.c | 379 +++++++++++++++++++++++++++++++++++++++ drivers/input/keyboard/Kconfig | 12 + drivers/input/keyboard/Makefile | 1 drivers/input/misc/pcspkr.c | 24 ++ drivers/input/mouse/98busmouse.c | 201 ++++++++++++++++++++ drivers/input/mouse/Kconfig | 12 + drivers/input/mouse/Makefile | 1 drivers/input/serio/98kbd-io.c | 181 ++++++++++++++++++ drivers/input/serio/Kconfig | 12 + drivers/input/serio/Makefile | 1 include/linux/kbd_kern.h | 5 include/linux/keyboard.h | 1 include/linux/serio.h | 1 14 files changed, 833 insertions(+), 2 deletions(-)
Signature · 2 lines
Osamu Tomita [email protected]
drivers/input/keyboard/Kconfig +12 -0
@@ -88,3 +88,15 @@ The module will be called amikbd.o. If you want to compile it as a module, say M here and read <file:Documentation/modules.txt>. +config KEYBOARD_98KBD + tristate "NEC PC-9800 Keyboard support" + depends on PC9800 && INPUT && INPUT_KEYBOARD && SERIO + help + Say Y here if you want to use the NEC PC-9801/PC-9821 keyboard (or + compatible) on your system. + + This driver is also available as a module ( = code which can be + inserted in and removed from the running kernel whenever you want). + The module will be called xtkbd.o. If you want to compile it as a + module, say M here and read <file:Documentation/modules.txt>. +
drivers/input/keyboard/Makefile +1 -0
@@ -10,6 +10,7 @@ obj-$(CONFIG_KEYBOARD_XTKBD) += xtkbd.o obj-$(CONFIG_KEYBOARD_AMIGA) += amikbd.o obj-$(CONFIG_KEYBOARD_NEWTON) += newtonkbd.o +obj-$(CONFIG_KEYBOARD_98KBD) += 98kbd.o # The global Rules.make.
drivers/input/keyboard/98kbd.c +379 -0
379 lines not on this page · raw message
drivers/input/misc/pcspkr.c +24 -0
@@ -12,6 +12,7 @@* the Free Software Foundation */ +#include <linux/config.h> #include <linux/kernel.h> #include <linux/module.h> #include <linux/init.h>
@@ -23,7 +24,11 @@MODULE_LICENSE ("GPL" );static char pcspkr_name[] ="PC Speaker" ; +#ifndef CONFIG_PC9800 static char pcspkr_phys[] ="isa0061/input0" ; +#else +static char pcspkr_phys[] ="isa3fdb/input0" ; +#endif static struct input_dev pcspkr_dev;spinlock_t i8253_beep_lock =SPIN_LOCK_UNLOCKED ;
@@ -43,11 +48,16 @@ } if (value > 20 && value < 32767) +#ifndef CONFIG_PC9800 count =1193182 / value; +#else + count =CLOCK_TICK_RATE / value; +#endif spin_lock_irqsave (&i8253_beep_lock, flags);if (count) { +#ifndef CONFIG_PC9800 /* enable counter 2 */ outb_p (inb_p (0x61 ) |3 ,0x61 );/* set command for counter 2, 2 byte write */
@@ -55,9 +65,23 @@/* select desired HZ */ outb_p (count &0xff ,0x42 );outb ((count >>8 ) &0xff ,0x42 ); +#else /* CONFIG_PC9800 */ +outb (0x76 ,0x3fdf ); +outb (0 ,0x5f ); +outb (count &0xff ,0x3fdb ); +outb (0 ,0x5f ); +outb ((count >>8 ) &0xff ,0x3fdb ); +/* beep on */ +outb (6 ,0x37 ); +#endif /* !CONFIG_PC9800 */ }else {/* disable counter 2 */ +#ifndef CONFIG_PC9800 outb (inb_p (0x61 ) &0xFC ,0x61 ); +#else +/* beep off */ +outb (7 ,0x37 ); +#endif }spin_unlock_irqrestore (&i8253_beep_lock, flags);
drivers/input/mouse/98busmouse.c +201 -0
201 lines not on this page · raw message
drivers/input/mouse/Kconfig +12 -0
@@ -119,3 +119,15 @@ The module will be called rpcmouse.o. If you want to compile it as a module, say M here and read <file.:Documentation/modules.txt>. +config MOUSE_PC9800 + tristate "NEC PC-9800 busmouse" + depends on PC9800 && INPUT && INPUT_MOUSE && ISA + help + Say Y here if you have NEC PC-9801/PC-9821 computer and want its + native mouse supported. + + This driver is also available as a module ( = code which can be + inserted in and removed from the running kernel whenever you want). + The module will be called logibm.o. If you want to compile it as a + module, say M here and read <file.:Documentation/modules.txt>. +
drivers/input/mouse/Makefile +1 -0
@@ -10,6 +10,7 @@ obj-$(CONFIG_MOUSE_LOGIBM) += logibm.o obj-$(CONFIG_MOUSE_MAPLE) += maplemouse.o obj-$(CONFIG_MOUSE_PC110PAD) += pc110pad.o +obj-$(CONFIG_MOUSE_PC9800) += 98busmouse.o obj-$(CONFIG_MOUSE_PS2) += psmouse.o obj-$(CONFIG_MOUSE_SERIAL) += sermouse.o
drivers/input/serio/Kconfig +12 -0
@@ -103,3 +103,15 @@ tristate "Intel SA1111 keyboard controller" depends on SA1111 && SERIO +config SERIO_98KBD + tristate "NEC PC-9800 keyboard controller" + depends on PC9800 && SERIO + help + Say Y here if you have the NEC PC-9801/PC-9821 and want to use its + standard keyboard connected to its keyboard controller. + + This driver is also available as a module ( = code which can be + inserted in and removed from the running kernel whenever you want). + The module will be called rpckbd.o. If you want to compile it as a + module, say M here and read <file:Documentation/modules.txt>. +
drivers/input/serio/Makefile +1 -0
@@ -17,6 +17,7 @@ obj-$(CONFIG_SERIO_SA1111) += sa1111ps2.o obj-$(CONFIG_SERIO_AMBAKMI) += ambakmi.o obj-$(CONFIG_SERIO_Q40KBD) += q40kbd.o +obj-$(CONFIG_SERIO_98KBD) += 98kbd-io.o # The global Rules.make.
drivers/input/serio/98kbd-io.c +181 -0
181 lines not on this page · raw message
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
include/linux/serio.h +1 -0
@@ -97,6 +97,7 @@#define SERIO_8042 0x01000000UL#define SERIO_RS232 0x02000000UL#define SERIO_HIL_MLC 0x03000000UL +#define SERIO_PC9800 0x04000000UL#define SERIO_PROTO 0xFFUL#define SERIO_MSC 0x01
PC-9800 patch for 2.5.47-ac4: not merged yet (9/15) kernel
In reply to Osamu TomitaThis is rest of core patch under kernel/.
diffstat:
kernel/dma.c | 3 +++ kernel/ksyms.c | 4 ++++ kernel/timer.c | 5 +++++ 3 files changed, 12 insertions(+)
Signature · 2 lines
Osamu Tomita [email protected]
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
@@ -601,5 +601,9 @@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
@@ -436,8 +436,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)));
PC-9800 patch for 2.5.47-ac4: not merged yet (10/15)
In reply to Osamu TomitaThis is for PC-9800's standard parallel port support.
diffstat:
drivers/char/Kconfig | 22 + drivers/char/lp_old98.c | 577 +++++++++++++++++++++++++++++++++++++++++++ drivers/parport/parport_pc.c | 68 ++++- include/linux/parport_pc.h | 10 4 files changed, 671 insertions(+), 6 deletions(-)
Signature · 2 lines
Osamu Tomita [email protected]
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 )
@@ -2994,6 +3028,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)); }
drivers/char/Kconfig +21 -1
@@ -574,6 +574,17 @@ console. This driver allows each pSeries partition to have a console which is accessed via the HMC. +config PC9800_OLDLP + tristate "NEC PC-9800 old-style printer port support" + depends on PC9800 && !PARPORT + ---help--- + If you intend to attach a printer to the parallel port of NEC PC-9801 + /PC-9821 with OLD compatibility mode, Say Y. + +config PC9800_OLDLP_CONSOLE + bool "Support for console on line printer" + depends on PC9800_OLDLP + source "drivers/i2c/Kconfig"
@@ -1053,7 +1064,7 @@ config RTC tristate "Enhanced Real Time Clock Support" - depends on PPC32 != y && PARISC != y + depends on PPC32 != y && PARISC != y && PC9800 != y ---help--- If you say Y here and create a character special file /dev/rtc with major number 10 and minor number 135 using mknod ("man mknod"), you
@@ -1112,6 +1123,15 @@ bool "EFI Real Time Clock Services" depends on IA64 +config RTC98 + tristate "NEC PC-9800 Real Time Clock Support" + depends on PC9800 + default y + ---help--- + If you say Y here and create a character special file /dev/rtc with + major number 10 and minor number 135 using mknod ("man mknod"), you + will get access to the real time clock (or hardware clock) built + config H8 bool "Tadpole ANA H8 Support (OBSOLETE)" depends on OBSOLETE && ALPHA_BOOK1
drivers/char/lp_old98.c +577 -0
577 lines not on this page · raw message
PC-9800 patch for 2.5.47-ac4: not merged yet (11/15) PCI
In reply to Osamu TomitaThis is rest of PCI support patch.
diffstat:
arch/i386/pci/irq.c | 27 +++++++++++++++++++++++++++ drivers/pci/quirks.c | 1 + drivers/pcmcia/yenta.c | 6 ++++++ include/asm-i386/pci.h | 4 ++++ 4 files changed, 38 insertions(+)
Signature · 2 lines
Osamu Tomita [email protected]
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
@@ -3,6 +3,7 @@* * (C) Copyright 1999, 2000 Linus Torvalds */ +#include <linux/config.h> #include <linux/init.h> #include <linux/pci.h> #include <linux/sched.h>
@@ -505,6 +506,7 @@add_timer (&socket->poll_timer); } +#ifndef CONFIG_PC9800 /* * Only probe "regular" interrupts, don't * touch dangerous spots like the mouse irq,
@@ -515,6 +517,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) {
drivers/pci/quirks.c +1 -0
@@ -520,6 +520,7 @@ { PCI_FIXUP_FINAL, PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_0, quirk_isa_dma_hangs }, { 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_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 },
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 );
PC-9800 patch for 2.5.47-ac4: not merged yet (12/15) PNP
In reply to Osamu TomitaThis is for legacy bus PNP support.
diffstat:
drivers/pnp/isapnp/core.c | 5 +++++ 1 files changed, 5 insertions(+)
Signature · 2 lines
Osamu Tomita [email protected]
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
PC-9800 patch for 2.5.47-ac4: not merged yet (13/15) SCSI
In reply to Osamu TomitaThis is for SCSI host cards support.
diffstat:
drivers/scsi/Kconfig | 7 + drivers/scsi/Makefile | 3 drivers/scsi/pc980155.c | 262 ++++++++++++++++++++++++++++++++++++++++++++ drivers/scsi/pc980155.h | 47 +++++++ drivers/scsi/pc980155regs.h | 89 ++++++++++++++ drivers/scsi/scsi_scan.c | 1 drivers/scsi/scsi_syms.c | 5 drivers/scsi/scsicam.c | 68 +++++++++++ drivers/scsi/sd.c | 24 +++- drivers/scsi/wd33c93.c | 57 ++++++--- drivers/scsi/wd33c93.h | 5 include/scsi/scsicam.h | 2 12 files changed, 548 insertions(+), 22 deletions(-)
Signature · 2 lines
Osamu Tomita [email protected]
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 +2 -1
@@ -18,7 +18,7 @@ CFLAGS_gdth.o = # -DDEBUG_GDTH=2 -D__SERIAL__ -D__COM2__ -DGDTH_STATISTICS CFLAGS_seagate.o = -DARBITRATE -DPARITY -DSEAGATE_USE_ASM -export-objs := scsi_syms.o 53c700.o +export-objs := scsi_syms.o 53c700.o wd33c93.o subdir-$(CONFIG_PCMCIA) += pcmcia
@@ -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
drivers/scsi/pc980155.c +262 -0
262 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
@@ -131,6 +131,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 +5 -0
@@ -98,6 +98,11 @@EXPORT_SYMBOL (scsi_host_put);EXPORT_SYMBOL (scsi_device_types); +/* For PC-9800 architecture support */ +EXPORT_SYMBOL (pc9800_scsi_bios_param); +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/scsicam.c +68 -0
77 lines not on this page · raw message
drivers/scsi/sd.c +23 -1
@@ -196,6 +196,7 @@case HDIO_GETGEO :/* Return BIOS disk parameters */ {struct hd_geometry *loc = (struct hd_geometry *)arg; +extern int pc98;if (!loc)return -EINVAL ;
@@ -211,7 +212,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
@@ -1322,6 +1323,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 ;
include/scsi/scsicam.h +2 -0
@@ -16,4 +16,6 @@extern int scsi_partsize (unsigned char *buf,unsigned long capacity,unsigned int *cyls,unsigned int *hds,unsigned int *secs);extern unsigned char *scsi_bios_ptable (struct block_device *bdev); +extern int pc9800_scsi_bios_param (struct block_device *bdev,sector_t capacity, +int *ip);#endif /* def SCSICAM_H */
PC-9800 patch for 2.5.47-ac4: not merged yet (14/15) serial
In reply to Osamu TomitaThis is for serial port and onboard modem support.
diffstat:
drivers/serial/8250_pnp.c | 7 +++++++ include/asm-i386/serial.h | 7 +++++++ 2 files changed, 14 insertions(+)
Signature · 2 lines
Osamu Tomita [email protected]
drivers/serial/8250_pnp.c +7 -0
@@ -193,6 +193,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 */
@@ -376,7 +378,12 @@ ((port->min ==0x2f8 ) || (port->min ==0x3f8 ) || (port->min ==0x2e8 ) || +#ifndef CONFIG_PC9800 (port->min == 0x3e8))) +#else + (port->min ==0x3e8 ) || + (port->min == 0x8b0))) +#endif return 0; }
include/asm-i386/serial.h +7 -0
@@ -50,12 +50,19 @@#define C_P (card,port) (((card)<<6|(port)<<3) + 1) +#ifndef CONFIG_PC9800 #define STD_SERIAL_PORT_DEFNS \ /* UART CLK PORT IRQ FLAGS */ \ { 0, BASE_BAUD, 0x3F8, 4, STD_COM_FLAGS }, /* ttyS0 */ \ { 0, BASE_BAUD, 0x2F8, 3, STD_COM_FLAGS }, /* ttyS1 */ \ { 0, BASE_BAUD, 0x3E8, 4, STD_COM_FLAGS }, /* ttyS2 */ \ { 0, BASE_BAUD, 0x2E8, 3, STD_COM4_FLAGS }, /* ttyS3 */ +#else +#define STD_SERIAL_PORT_DEFNS \ + /* UART CLK PORT IRQ FLAGS */ \ + { 0, BASE_BAUD, 0x30, 4, STD_COM_FLAGS }, /* ttyS0 */ \ + { 0, BASE_BAUD, 0x238, 5, STD_COM_FLAGS }, /* ttyS1 */ +#endif /* CONFIG_PC9800 */ #ifdef CONFIG_SERIAL_MANY_PORTS
Re: PC-9800 patch for 2.5.47-ac4: not merged yet (14/15) serial
Quoted 4 lines · Osamu Tomita
This is for serial port and onboard modem support.
drivers/serial/8250_pnp.c +0
-0@@ -376,7 +378,12 @@ ((port->min == 0x2f8) ||
drivers/serial/8250_pnp.c line 388
Quoted 10 lines
drivers/serial/8250_pnp.c +5
-0(port->min ==0x3f8 ) || (port->min ==0x2e8 ) || +#ifndef CONFIG_PC9800 (port->min == 0x3e8))) +#else + (port->min ==0x3e8 ) || + (port->min == 0x8b0))) +#endif return 0; }
Why 0x8b0 should be added here ?
Is it one of default iobase value for C-bus PNP modems ?
Signature · 2 lines
Andrey Panin | Embedded systems software developer [email protected] | PGP key: wwwkeys.eu.pgp.net
A message that is not in the archive (sent off-list or not yet received): [email protected]
Re: PC-9800 patch for 2.5.47-ac4: not merged yet (14/15) serial
Quoted 20 lines · Osamu Tomita
Quoted 4 lines · Andrey Panin
Quoted 1 line · Osamu Tomita
This is for serial port and onboard modem support.
Quoted 15 lines
drivers/serial/8250_pnp.c line 388
Quoted 12 lines
drivers/serial/8250_pnp.c +5
-0@@ -376,7 +378,12 @@ ((port->min ==0x2f8 ) || (port->min ==0x3f8 ) || (port->min ==0x2e8 ) || +#ifndef CONFIG_PC9800 (port->min == 0x3e8))) +#else + (port->min ==0x3e8 ) || + (port->min == 0x8b0))) +#endif return 0; }Why
0x8b0should be added here ?
Is it one of default iobase value for C-bus PNP modems ?
Quoted 2 lines
Yes. C-bus PNP modems use this default value. And old modem card is hard wired to this iobase.
Ok. But IMHO this way is better (check order doesn't matter here):
((port->min == 0x2f8) ||
(port->min == 0x3f8) ||
(port->min == 0x2e8) ||
(port->min == 0x3e8) ||
#ifdef CONFIG_PC9800
(port->min == 0x8b0) ||#endif
(port->min == 0x3e8)))
return 0;
}Signature · 2 lines
Andrey Panin | Embedded systems software developer [email protected] | PGP key: wwwkeys.eu.pgp.net
PC-9800 patch for 2.5.47-ac4: not merged yet (15/15) SMP
In reply to Osamu TomitaThis is for SMP support.
diffstat:
arch/i386/kernel/apic.c | 16 +++++++++++++--- arch/i386/kernel/io_apic.c | 25 +++++++++++++++++++++++-- arch/i386/kernel/mpparse.c | 35 ++++++++++++++++++++++++++++++++++- arch/i386/kernel/smpboot.c | 14 ++++++++++++++ include/asm-i386/mpspec.h | 4 +++- include/asm-i386/smpboot.h | 9 +++++++++ 6 files changed, 96 insertions(+), 7 deletions(-)
Signature · 2 lines
Osamu Tomita [email protected]
arch/i386/kernel/apic.c +13 -3
@@ -33,6 +33,8 @@#include <asm/arch_hooks.h> #include "mach_apic.h" +#include "io_ports.h" +void __init apic_intr_init (void ) {#ifdef CONFIG_SMP
@@ -135,9 +137,13 @@* PIC mode, enable APIC mode in the IMCR, i.e. * connect BSP's local APIC to INT and NMI lines. */ +#ifndef CONFIG_PC9800 printk ("leaving PIC mode, enabling APIC mode.\n" );outb (0x70 ,0x22 );outb (0x01 ,0x23 ); +#else +printk ("On NEC98, Changing mode from PIC to APIC isNOT supported yet.\n" ); +#endif } }
@@ -150,9 +156,13 @@* interrupts, including IPIs, won't work beyond * this point! The only exception are INIT IPIs. */ +#ifndef CONFIG_PC9800 printk ("disabling APIC mode, entering PIC mode.\n" );outb (0x70 ,0x22 );outb (0x00 ,0x23 ); +#else +printk ("On NEC98, Changing mode from APIC to PIC isNOT supported yet.\n" ); +#endif } }
@@ -759,9 +769,9 @@spin_lock_irqsave (&i8253_lock, flags); -outb_p (0x00 ,0x43 ); - count =inb_p (0x40 ); - count |=inb_p (0x40 ) <<8 ; +outb_p (0x00 ,PIT_MODE ); + count =inb_p (PIT_CH0 ); + count |=inb_p (PIT_CH0 ) <<8 ;spin_unlock_irqrestore (&i8253_lock, flags);
arch/i386/kernel/io_apic.c +23 -2
@@ -37,6 +37,8 @@#include <asm/desc.h> #include "mach_apic.h" +#include "io_ports.h" +#undef APIC_LOCKUP_DEBUG#define APIC_LOCKUP_DEBUG
@@ -354,7 +356,9 @@if ((mp_bus_id_to_type[lbus] ==MP_BUS_ISA || mp_bus_id_to_type[lbus] ==MP_BUS_EISA || - mp_bus_id_to_type[lbus] ==MP_BUS_MCA ) && + mp_bus_id_to_type[lbus] ==MP_BUS_MCA || + mp_bus_id_to_type[lbus] ==MP_BUS_NEC98 + ) && (mp_irqs[i].mpc_irqtype == type) && (mp_irqs[i].mpc_srcbusirq == irq))
@@ -448,6 +452,12 @@#define default_MCA_trigger (idx) (1)#define default_MCA_polarity (idx) (0) +/* NEC98 interrupts are always polarity zero edge triggered, +* when listed as conforming in the MP table. */ + +#define default_NEC98_trigger (idx) (0) +#define default_NEC98_polarity (idx) (0) +static int __init MPBIOS_polarity (int idx) {int bus = mp_irqs[idx].mpc_srcbus;
@@ -482,6 +492,11 @@ polarity =default_MCA_polarity (idx);break ; } +case MP_BUS_NEC98 :/* NEC 98 pin */ + { + polarity =default_NEC98_polarity (idx); +break ; + }default : {printk (KERN_WARNING "broken BIOS!!\n" );
@@ -551,6 +566,11 @@ trigger =default_MCA_trigger (idx);break ; } +case MP_BUS_NEC98 :/* NEC 98 pin */ + { + trigger =default_NEC98_trigger (idx); +break ; + }default : {printk (KERN_WARNING "broken BIOS!!\n" );
@@ -612,6 +632,7 @@case MP_BUS_ISA :/* ISA pin */ case MP_BUS_EISA :case MP_BUS_MCA : +case MP_BUS_NEC98 : { irq = mp_irqs[idx].mpc_srcbusirq;break ;
@@ -1718,7 +1739,7 @@* Additionally, something is definitely wrong with irq9 * on PIIX4 boards. */ -#define PIC_IRQS (1<<2) +#define PIC_IRQS (1 << PIC_CASCADE_IR)void __init setup_IO_APIC (void ) {
arch/i386/kernel/mpparse.c +34 -1
@@ -236,6 +236,8 @@ mp_current_pci_id++; }else if (strncmp (str,BUSTYPE_MCA ,sizeof (BUSTYPE_MCA )-1 ) ==0 ) { mp_bus_id_to_type[m->mpc_busid] =MP_BUS_MCA ; + }else if (strncmp (str,BUSTYPE_NEC98 ,sizeof (BUSTYPE_NEC98 )-1 ) ==0 ) { + mp_bus_id_to_type[m->mpc_busid] =MP_BUS_NEC98 ; }else {printk ("Unknown bustype %s - ignoring\n" , str); }
@@ -681,7 +683,12 @@* Read the physical hardware table. Anything here will * override the defaults. */ -if (!smp_read_mpc ((void *)mpf->mpf_physptr)) { +#ifndef CONFIG_PC9800 +if (!smp_read_mpc ((void *)mpf->mpf_physptr)) +#else + if (!smp_read_mpc(phys_to_virt(mpf->mpf_physptr))) +#endif + { 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" );
@@ -735,8 +742,30 @@printk ("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 ; }
@@ -748,7 +777,9 @@void __init find_smp_config (void ) { +#ifndef CONFIG_PC9800 unsigned int address; +#endif /* * FIXME: Linux assumes you have 640K of base ram..
@@ -762,6 +793,7 @@smp_scan_config (639 *0x400 ,0x400 ) || smp_scan_config(0xF0000,0x10000)) return; +#ifndef CONFIG_PC9800 /* PC-9800 has no EBDA area? */ /* * If it is an SMP machine we should know now, unless the * configuration is in an EISA/MCA bus machine with an
@@ -784,6 +816,7 @@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" ); +#endif }
arch/i386/kernel/smpboot.c +14 -0
@@ -855,13 +855,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/mpspec.h +3 -1
@@ -105,6 +105,7 @@#define BUSTYPE_TC "TC"#define BUSTYPE_VME "VME"#define BUSTYPE_XPRESS "XPRESS" +#define BUSTYPE_NEC98 "NEC98"struct mpc_config_ioapic {
@@ -195,7 +196,8 @@MP_BUS_ISA =1 ,MP_BUS_EISA ,MP_BUS_PCI , - MP_BUS_MCA +MP_BUS_MCA , + MP_BUS_NEC98 };extern int mp_bus_id_to_type [MAX_MP_BUSSES ];extern int mp_bus_id_to_node [MAX_MP_BUSSES ];
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: PC-9800 patch for 2.5.47-ac4: not merged yet (15/15) SMP
Quoted 19 lines · Osamu Tomita
This is for SMP support.
void
__initfind_smp_config(void)
{arch/i386/kernel/mpparse.c +3
-0+#ifndef CONFIG_PC9800 unsigned int address; +#endif /* * FIXME: Linux assumes you have 640K of base ram.. @@ -762,6 +793,7 @@smp_scan_config (639 *0x400 ,0x400 ) || smp_scan_config(0xF0000,0x10000)) return; +#ifndef CONFIG_PC9800 /* PC-9800 has no EBDA area? */ /* * If it is an SMP machine we should know now, unless the * configuration is in an EISA/MCA bus machine with an
arch/i386/kernel/mpparse.c line 820
Quoted 5 lines
arch/i386/kernel/mpparse.c +1
-0@@ -784,6 +816,7 @@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" ); +#endif }
Can you redo this fragment this way ?
#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);
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");
}#endif
IMHO this is better way (one #ifndef less)
Signature · 2 lines
Andrey Panin | Embedded systems software developer [email protected] | PGP key: wwwkeys.eu.pgp.net
Quoted 3 lines · Osamu Tomita
Thanks for interest in PC-9800 subarchitecture support. I've made additional patch for 2.5.47-ac4 to support PC-9800 completely. Would you please merge into your tree?
I'll look over them if and when I get time. Fixing the IDE and some of the other stuff is more important to me (although maybe not to PC98 users 8))
Quoted 9 lines · Alan Cox
Quoted 3 lines · Osamu Tomita
Thanks for interest in PC-9800 subarchitecture support. I've made additional patch for 2.5.47-ac4 to support PC-9800 completely. Would you please merge into your tree?
I'll look over them if and when I get time. Fixing the IDE and some of the other stuff is more important to me (although maybe not to PC98 users 8))
I see. Thanks. I'll be happy if that day will come earlier.
Regards,
Osamu