Skip to contentSkip to conversation

add support for PC-9800 architecture (core #2)

PATCH In review Osamu Tomita 1 participant 1 message Oct 28, 2002

lore
Share & tools
lore
#0 lore raw

PATCH 5/23 add support for PC-9800 architecture (core #2)

This is a part 5/23 of patchset for add support NEC PC-9800 architecture, against 2.5.44.

Summary:
core modules (continued)

diffstat:

 include/asm-i386/bugs.h         |    2 
 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_debug.h |  152 +++++++++++++++++++++++++
 include/asm-i386/pc9800_dma.h   |  238 ++++++++++++++++++++++++++++++++++++++++
 include/asm-i386/pc9800_sca.h   |   25 ++++
 include/asm-i386/pgtable.h      |    4 
 include/asm-i386/processor.h    |    2 
 include/asm-i386/scatterlist.h  |    6 +
 include/asm-i386/setup.h        |    1 
 include/asm-i386/timex.h        |    4 
 13 files changed, 477 insertions(+), 1 deletion(-)

patch:

include/asm-i386/bugs.h +2 -0
diff -urN linux/include/asm-i386/bugs.h linux98/include/asm-i386/bugs.h
@@ -34,6 +34,7 @@
 
 __setup("no-hlt", no_halt);
 
+#ifndef CONFIG_PC9800
 static int __init mca_pentium(char *s)
 {
 	mca_pentium_flag = 1;
@@ -41,6 +42,7 @@
 }
 
 __setup("mca-pentium", mca_pentium);
+#endif
 
 static int __init no_387(char *s)
 {
include/asm-i386/dma.h +7 -0
diff -urN linux/include/asm-i386/dma.h linux98/include/asm-i386/dma.h
@@ -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
diff -urN linux/include/asm-i386/io.h linux98/include/asm-i386/io.h
@@ -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
diff -urN linux/include/asm-i386/irq.h linux98/include/asm-i386/irq.h
@@ -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
diff -urN linux/include/asm-i386/pc9800.h linux98/include/asm-i386/pc9800.h
@@ -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_debug.h +152 -0

152 lines not on this page · raw message

include/asm-i386/pc9800_dma.h +238 -0

238 lines not on this page · raw message

include/asm-i386/pc9800_sca.h +25 -0
diff -urN linux/include/asm-i386/pc9800_sca.h linux98/include/asm-i386/pc9800_sca.h
@@ -0,0 +1,25 @@
+/*
+ *  System-common area definitions for NEC PC-9800 series
+ *
+ *  Copyright (C) 1999	TAKAI Kousuke <[email protected]>,
+ *			Kyoto University Microcomputer Club.
+ */
+
+#ifndef _ASM_I386_PC9800SCA_H_
+#define _ASM_I386_PC9800SCA_H_
+
+#define PC9800SCA_EXPMMSZ		(0x0401)	/* B */
+#define PC9800SCA_SCSI_PARAMS		(0x0460)	/* 8 * 4B */
+#define PC9800SCA_DISK_EQUIPS		(0x0482)	/* B */
+#define PC9800SCA_XROM_ID		(0x04C0)	/* 52B */
+#define PC9800SCA_BIOS_FLAG		(0x0501)	/* B */
+#define PC9800SCA_MMSZ16M		(0x0594)	/* W */
+
+/* PC-9821 have additional system common area in their BIOS-ROM segment. */
+
+#define PC9821SCA__BASE			(0xF8E8 << 4)
+#define PC9821SCA_ROM_ID		(PC9821SCA__BASE + 0x00)
+#define PC9821SCA_ROM_FLAG4		(PC9821SCA__BASE + 0x05)
+#define PC9821SCA_RSFLAGS		(PC9821SCA__BASE + 0x11)	/* B */
+
+#endif /* !_ASM_I386_PC9800SCA_H_ */
include/asm-i386/pgtable.h +4 -0
diff -urN linux/include/asm-i386/pgtable.h linux98/include/asm-i386/pgtable.h
@@ -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/processor.h +1 -1
diff -urN linux/include/asm-i386/processor.h linux98/include/asm-i386/processor.h
@@ -87,7 +87,7 @@
 #define current_cpu_data boot_cpu_data
 #endif
 
-extern char ignore_irq13;
+extern char ignore_fpu_irq;
 
 extern void identify_cpu(struct cpuinfo_x86 *);
 extern void print_cpu_info(struct cpuinfo_x86 *);
include/asm-i386/scatterlist.h +6 -0
diff -urN linux/include/asm-i386/scatterlist.h linux98/include/asm-i386/scatterlist.h
@@ -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/setup.h +1 -0
diff -urN linux/include/asm-i386/setup.h linux98/include/asm-i386/setup.h
@@ -28,6 +28,7 @@
 #define APM_BIOS_INFO (*(struct apm_bios_info *) (PARAM+0x40))
 #define DRIVE_INFO (*(struct drive_info_struct *) (PARAM+0x80))
 #define SYS_DESC_TABLE (*(struct sys_desc_table_struct*)(PARAM+0xa0))
+#define PC9800_MISC_FLAGS (*(unsigned char *)(PARAM+0x1AF))
 #define MOUNT_ROOT_RDONLY (*(unsigned short *) (PARAM+0x1F2))
 #define RAMDISK_FLAGS (*(unsigned short *) (PARAM+0x1F8))
 #define VIDEO_MODE (*(unsigned short *) (PARAM+0x1FA))
include/asm-i386/timex.h +4 -0
diff -urN linux/include/asm-i386/timex.h linux98/include/asm-i386/timex.h
@@ -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) * \