summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@home.transmeta.com>2003-03-21 02:59:35 -0800
committerLinus Torvalds <torvalds@home.transmeta.com>2003-03-21 02:59:35 -0800
commit7284d6473e5515cdcf5f4cf296e657e47743c926 (patch)
tree51616cd6a4b90c43df3d2c2fe4b38c859c928652 /include/linux
parent2a9901d6da0dd45aa3a97a2346b3e967073a0276 (diff)
parentcc4e6724fe984061ea97e0692de811ce3e7da9d8 (diff)
Merge ssh://master.kernel.org//home/hch/BK/xfs/linux-2.5/
into home.transmeta.com:/home/torvalds/v2.5/linux
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/i2o.h47
-rw-r--r--include/linux/ide.h40
-rw-r--r--include/linux/pci_ids.h19
-rw-r--r--include/linux/serial_core.h8
-rw-r--r--include/linux/upd4990a.h140
5 files changed, 199 insertions, 55 deletions
diff --git a/include/linux/i2o.h b/include/linux/i2o.h
index 8414aa21113b..c4a46f2f7893 100644
--- a/include/linux/i2o.h
+++ b/include/linux/i2o.h
@@ -23,7 +23,7 @@
#include <linux/i2o-dev.h>
/* How many different OSM's are we allowing */
-#define MAX_I2O_MODULES 64
+#define MAX_I2O_MODULES 4
/* How many OSMs can register themselves for device status updates? */
#define I2O_MAX_MANAGERS 4
@@ -76,10 +76,16 @@ struct i2o_device
};
/*
- * Resource data for each PCI I2O controller
+ * Each I2O controller has one of these objects
*/
-struct i2o_pci
+struct i2o_controller
{
+ char name[16];
+ int unit;
+ int type;
+ int enabled;
+
+ struct pci_dev *pdev; /* PCI device */
int irq;
int short_req:1; /* Use small block sizes */
int dpt:1; /* Don't quiesce */
@@ -88,25 +94,6 @@ struct i2o_pci
int mtrr_reg0;
int mtrr_reg1;
#endif
-};
-
-/*
- * Transport types supported by I2O stack
- */
-#define I2O_TYPE_PCI 0x01 /* PCI I2O controller */
-
-
-/*
- * Each I2O controller has one of these objects
- */
-struct i2o_controller
-{
- struct pci_dev *pdev; /* PCI device */
-
- char name[16];
- int unit;
- int type;
- int enabled;
struct notifier_block *event_notifer; /* Events */
atomic_t users;
@@ -143,22 +130,6 @@ struct i2o_controller
struct proc_dir_entry *proc_entry; /* /proc dir */
- union { /* Bus information */
- struct i2o_pci pci;
- } bus;
-
- /* Bus specific destructor */
- void (*destructor)(struct i2o_controller *);
-
- /* Bus specific attach/detach */
- int (*bind)(struct i2o_controller *, struct i2o_device *);
-
- /* Bus specific initiator */
- int (*unbind)(struct i2o_controller *, struct i2o_device *);
-
- /* Bus specific enable/disable */
- void (*bus_enable)(struct i2o_controller *);
- void (*bus_disable)(struct i2o_controller *);
void *page_frame; /* Message buffers */
dma_addr_t page_frame_map; /* Cache map */
diff --git a/include/linux/ide.h b/include/linux/ide.h
index fb6473237d52..813c37500937 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -280,9 +280,6 @@ typedef unsigned char byte; /* used everywhere */
return ((hwif)->chipset == chipset) ? 1 : 0; \
}
-#define IDE_DEBUG(lineno) \
- printk("%s,%s,line=%d\n", __FILE__, __FUNCTION__, (lineno))
-
/*
* Check for an interrupt and acknowledge the interrupt status
*/
@@ -302,7 +299,8 @@ typedef enum { ide_unknown, ide_generic, ide_pci,
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;
/*
@@ -728,6 +726,7 @@ typedef struct ide_drive_s {
unsigned present : 1; /* drive is physically present */
unsigned dead : 1; /* device ejected hint */
+ unsigned id_read : 1; /* 1=id read from disk 0 = synthetic */
unsigned noprobe : 1; /* from: hdx=noprobe */
unsigned removable : 1; /* 1 if need to do check_media_change */
unsigned is_flash : 1; /* 1 if probed as flash */
@@ -847,7 +846,7 @@ typedef struct ide_dma_ops_s {
#define task_rq_offset(rq) \
(((rq)->nr_sectors - (rq)->current_nr_sectors) * SECTOR_SIZE)
-extern inline void *ide_map_buffer(struct request *rq, unsigned long *flags)
+static inline void *ide_map_buffer(struct request *rq, unsigned long *flags)
{
/*
* fs request
@@ -861,7 +860,7 @@ extern inline void *ide_map_buffer(struct request *rq, unsigned long *flags)
return rq->buffer + task_rq_offset(rq);
}
-extern inline void ide_unmap_buffer(struct request *rq, char *buffer, unsigned long *flags)
+static inline void ide_unmap_buffer(struct request *rq, char *buffer, unsigned long *flags)
{
if (rq->bio)
bio_kunmap_irq(buffer, flags);
@@ -975,7 +974,7 @@ typedef struct hwif_s {
ide_startstop_t (*ide_dma_queued_start)(ide_drive_t *drive);
void (*OUTB)(u8 addr, unsigned long port);
- void (*OUTBSYNC)(u8 addr, unsigned long port);
+ void (*OUTBSYNC)(ide_drive_t *drive, u8 addr, unsigned long port);
void (*OUTW)(u16 addr, unsigned long port);
void (*OUTL)(u32 addr, unsigned long port);
void (*OUTSW)(unsigned long port, void *addr, u32 count);
@@ -1181,6 +1180,7 @@ typedef struct ide_driver_s {
int (*end_request)(ide_drive_t *, int, int);
u8 (*sense)(ide_drive_t *, const char *, u8);
ide_startstop_t (*error)(ide_drive_t *, const char *, u8);
+ ide_startstop_t (*abort)(ide_drive_t *, const char *);
int (*ioctl)(ide_drive_t *, struct inode *, struct file *, unsigned int, unsigned long);
void (*pre_reset)(ide_drive_t *);
unsigned long (*capacity)(ide_drive_t *);
@@ -1280,6 +1280,13 @@ byte ide_dump_status (ide_drive_t *drive, const char *msg, byte stat);
ide_startstop_t ide_error (ide_drive_t *drive, const char *msg, byte stat);
/*
+ * Abort a running command on the controller triggering the abort
+ * from a host side, non error situation
+ * (drive, msg)
+ */
+extern ide_startstop_t ide_abort(ide_drive_t *, const char *);
+
+/*
* Issue a simple drive command
* The drive must be selected beforehand.
*
@@ -1327,12 +1334,6 @@ extern unsigned long current_capacity (ide_drive_t *drive);
extern ide_startstop_t ide_do_reset (ide_drive_t *);
/*
- * Re-Start an operation for an IDE interface.
- * The caller should return immediately after invoking this.
- */
-extern int restart_request (ide_drive_t *, struct request *);
-
-/*
* This function is intended to be used prior to invoking ide_do_drive_cmd().
*/
extern void ide_init_drive_cmd (struct request *rq);
@@ -1727,6 +1728,19 @@ extern void ide_toggle_bounce(ide_drive_t *drive, int on);
extern int ide_set_xfer_rate(ide_drive_t *drive, u8 rate);
extern spinlock_t ide_lock;
+extern struct semaphore ide_cfg_sem;
+/*
+ * Structure locking:
+ *
+ * ide_cfg_sem and ide_lock together protect changes to
+ * ide_hwif_t->{next,hwgroup}
+ * ide_drive_t->next
+ *
+ * ide_hwgroup_t->busy: ide_lock
+ * ide_hwgroup_t->hwif: ide_lock
+ * ide_hwif_t->mate: constant, no locking
+ * ide_drive_t->hwif: constant, no locking
+ */
#define local_irq_set(flags) do { local_save_flags((flags)); local_irq_enable(); } while (0)
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index ba94052020f0..e8a9eb4b9a58 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -144,6 +144,7 @@
#define PCI_DEVICE_ID_COMPAQ_NETEL100I 0xb011
#define PCI_DEVICE_ID_COMPAQ_CISS 0xb060
#define PCI_DEVICE_ID_COMPAQ_CISSB 0xb178
+#define PCI_DEVICE_ID_COMPAQ_CISSC 0x46
#define PCI_DEVICE_ID_COMPAQ_THUNDER 0xf130
#define PCI_DEVICE_ID_COMPAQ_NETFLEX3B 0xf150
@@ -1832,8 +1833,8 @@
#define PCI_DEVICE_ID_INTEL_82801E_0 0x2450
#define PCI_DEVICE_ID_INTEL_82801E_2 0x2452
#define PCI_DEVICE_ID_INTEL_82801E_3 0x2453
-#define PCI_DEVICE_ID_INTEL_82801E_9 0x245b
-#define PCI_DEVICE_ID_INTEL_82801E_11 PCI_DEVICE_ID_INTEL_82801E_9
+#define PCI_DEVICE_ID_INTEL_82801E_9 0x2459
+#define PCI_DEVICE_ID_INTEL_82801E_11 0x245b
#define PCI_DEVICE_ID_INTEL_82801E_13 0x245d
#define PCI_DEVICE_ID_INTEL_82801E_14 0x245e
#define PCI_DEVICE_ID_INTEL_82801CA_0 0x2480
@@ -1853,10 +1854,20 @@
#define PCI_DEVICE_ID_INTEL_82801DB_5 0x24c5
#define PCI_DEVICE_ID_INTEL_82801DB_6 0x24c6
#define PCI_DEVICE_ID_INTEL_82801DB_7 0x24c7
-#define PCI_DEVICE_ID_INTEL_82801DB_9 0x24cb
-#define PCI_DEVICE_ID_INTEL_82801DB_11 PCI_DEVICE_ID_INTEL_82801DB_9
+#define PCI_DEVICE_ID_INTEL_82801DB_9 0x24c9
+#define PCI_DEVICE_ID_INTEL_82801DB_10 0x24ca
+#define PCI_DEVICE_ID_INTEL_82801DB_11 0x24cb
#define PCI_DEVICE_ID_INTEL_82801DB_12 0x24cc
#define PCI_DEVICE_ID_INTEL_82801DB_13 0x24cd
+#define PCI_DEVICE_ID_INTEL_82801EB_0 0x24d0
+#define PCI_DEVICE_ID_INTEL_82801EB_2 0x24d2
+#define PCI_DEVICE_ID_INTEL_82801EB_3 0x24d3
+#define PCI_DEVICE_ID_INTEL_82801EB_4 0x24d4
+#define PCI_DEVICE_ID_INTEL_82801EB_5 0x24d5
+#define PCI_DEVICE_ID_INTEL_82801EB_6 0x24d6
+#define PCI_DEVICE_ID_INTEL_82801EB_7 0x24d7
+#define PCI_DEVICE_ID_INTEL_82801EB_11 0x24db
+#define PCI_DEVICE_ID_INTEL_82801EB_13 0x24dd
#define PCI_DEVICE_ID_INTEL_82820_HB 0x2500
#define PCI_DEVICE_ID_INTEL_82820_UP_HB 0x2501
#define PCI_DEVICE_ID_INTEL_82850_HB 0x2530
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index 80ba519dda77..1a1fc33e134d 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -59,6 +59,14 @@
/* NEC v850. */
#define PORT_NB85E_UART 40
+/* NEC PC-9800 */
+#define PORT_8251_PC98 41
+#define PORT_19K_PC98 42
+#define PORT_FIFO_PC98 43
+#define PORT_VFAST_PC98 44
+#define PORT_PC9861 45
+#define PORT_PC9801_101 46
+
#ifdef __KERNEL__
diff --git a/include/linux/upd4990a.h b/include/linux/upd4990a.h
new file mode 100644
index 000000000000..ad5063490808
--- /dev/null
+++ b/include/linux/upd4990a.h
@@ -0,0 +1,140 @@
+/*
+ * Constant and architecture independent procedures
+ * for NEC uPD4990A serial I/O real-time clock.
+ *
+ * Copyright 2001 TAKAI Kousuke <tak@kmc.kyoto-u.ac.jp>
+ * Kyoto University Microcomputer Club (KMC).
+ *
+ * References:
+ * uPD4990A serial I/O real-time clock users' manual (Japanese)
+ * No. S12828JJ4V0UM00 (4th revision), NEC Corporation, 1999.
+ */
+
+#ifndef _LINUX_uPD4990A_H
+#define _LINUX_uPD4990A_H
+
+#include <asm/byteorder.h>
+
+#include <asm/upd4990a.h>
+
+/* Serial commands (4 bits) */
+#define UPD4990A_REGISTER_HOLD (0x0)
+#define UPD4990A_REGISTER_SHIFT (0x1)
+#define UPD4990A_TIME_SET_AND_COUNTER_HOLD (0x2)
+#define UPD4990A_TIME_READ (0x3)
+#define UPD4990A_TP_64HZ (0x4)
+#define UPD4990A_TP_256HZ (0x5)
+#define UPD4990A_TP_2048HZ (0x6)
+#define UPD4990A_TP_4096HZ (0x7)
+#define UPD4990A_TP_1S (0x8)
+#define UPD4990A_TP_10S (0x9)
+#define UPD4990A_TP_30S (0xA)
+#define UPD4990A_TP_60S (0xB)
+#define UPD4990A_INTERRUPT_RESET (0xC)
+#define UPD4990A_INTERRUPT_TIMER_START (0xD)
+#define UPD4990A_INTERRUPT_TIMER_STOP (0xE)
+#define UPD4990A_TEST_MODE_SET (0xF)
+
+/* Parallel commands (3 bits)
+ 0-6 are same with serial commands. */
+#define UPD4990A_PAR_SERIAL_MODE 7
+
+#ifndef UPD4990A_DELAY
+# include <linux/delay.h>
+# define UPD4990A_DELAY(usec) udelay((usec))
+#endif
+#ifndef UPD4990A_OUTPUT_DATA
+# define UPD4990A_OUTPUT_DATA(bit) \
+ do { \
+ UPD4990A_OUTPUT_DATA_CLK((bit), 0); \
+ UPD4990A_DELAY(1); /* t-DSU */ \
+ UPD4990A_OUTPUT_DATA_CLK((bit), 1); \
+ UPD4990A_DELAY(1); /* t-DHLD */ \
+ } while (0)
+#endif
+
+static __inline__ void upd4990a_serial_command(int command)
+{
+ UPD4990A_OUTPUT_DATA(command >> 0);
+ UPD4990A_OUTPUT_DATA(command >> 1);
+ UPD4990A_OUTPUT_DATA(command >> 2);
+ UPD4990A_OUTPUT_DATA(command >> 3);
+ UPD4990A_DELAY(1); /* t-HLD */
+ UPD4990A_OUTPUT_STROBE(1);
+ UPD4990A_DELAY(1); /* t-STB & t-d1 */
+ UPD4990A_OUTPUT_STROBE(0);
+ /* 19 microseconds extra delay is needed
+ iff previous mode is TIME READ command */
+}
+
+struct upd4990a_raw_data {
+ u8 sec; /* BCD */
+ u8 min; /* BCD */
+ u8 hour; /* BCD */
+ u8 mday; /* BCD */
+#if defined __LITTLE_ENDIAN_BITFIELD
+ unsigned wday :4; /* 0-6 */
+ unsigned mon :4; /* 1-based */
+#elif defined __BIG_ENDIAN_BITFIELD
+ unsigned mon :4; /* 1-based */
+ unsigned wday :4; /* 0-6 */
+#else
+# error Unknown bitfield endian!
+#endif
+ u8 year; /* BCD */
+};
+
+static __inline__ void upd4990a_get_time(struct upd4990a_raw_data *buf,
+ int leave_register_hold)
+{
+ int byte;
+
+ upd4990a_serial_command(UPD4990A_TIME_READ);
+ upd4990a_serial_command(UPD4990A_REGISTER_SHIFT);
+ UPD4990A_DELAY(19); /* t-d2 - t-d1 */
+
+ for (byte = 0; byte < 6; byte++) {
+ u8 tmp;
+ int bit;
+
+ for (tmp = 0, bit = 0; bit < 8; bit++) {
+ tmp = (tmp | (UPD4990A_READ_DATA() << 8)) >> 1;
+ UPD4990A_OUTPUT_CLK(1);
+ UPD4990A_DELAY(1);
+ UPD4990A_OUTPUT_CLK(0);
+ UPD4990A_DELAY(1);
+ }
+ ((u8 *) buf)[byte] = tmp;
+ }
+
+ /* The uPD4990A users' manual says that we should issue `Register
+ Hold' command after each data retrieval, or next `Time Read'
+ command may not work correctly. */
+ if (!leave_register_hold)
+ upd4990a_serial_command(UPD4990A_REGISTER_HOLD);
+}
+
+static __inline__ void upd4990a_set_time(const struct upd4990a_raw_data *data,
+ int time_set_only)
+{
+ int byte;
+
+ if (!time_set_only)
+ upd4990a_serial_command(UPD4990A_REGISTER_SHIFT);
+
+ for (byte = 0; byte < 6; byte++) {
+ int bit;
+ u8 tmp = ((const u8 *) data)[byte];
+
+ for (bit = 0; bit < 8; bit++, tmp >>= 1)
+ UPD4990A_OUTPUT_DATA(tmp);
+ }
+
+ upd4990a_serial_command(UPD4990A_TIME_SET_AND_COUNTER_HOLD);
+
+ /* Release counter hold and start the clock. */
+ if (!time_set_only)
+ upd4990a_serial_command(UPD4990A_REGISTER_HOLD);
+}
+
+#endif /* _LINUX_uPD4990A_H */