aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/cyclades.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/cyclades.h')
-rw-r--r--include/linux/cyclades.h229
1 files changed, 105 insertions, 124 deletions
diff --git a/include/linux/cyclades.h b/include/linux/cyclades.h
index 46d8254c1a79..72aa00cc4b2d 100644
--- a/include/linux/cyclades.h
+++ b/include/linux/cyclades.h
@@ -67,6 +67,8 @@
67#ifndef _LINUX_CYCLADES_H 67#ifndef _LINUX_CYCLADES_H
68#define _LINUX_CYCLADES_H 68#define _LINUX_CYCLADES_H
69 69
70#include <linux/types.h>
71
70struct cyclades_monitor { 72struct cyclades_monitor {
71 unsigned long int_count; 73 unsigned long int_count;
72 unsigned long char_count; 74 unsigned long char_count;
@@ -108,7 +110,6 @@ struct cyclades_idle_stats {
108#define CYZSETPOLLCYCLE 0x43590e 110#define CYZSETPOLLCYCLE 0x43590e
109#define CYZGETPOLLCYCLE 0x43590f 111#define CYZGETPOLLCYCLE 0x43590f
110#define CYGETCD1400VER 0x435910 112#define CYGETCD1400VER 0x435910
111#define CYGETCARDINFO 0x435911
112#define CYSETWAIT 0x435912 113#define CYSETWAIT 0x435912
113#define CYGETWAIT 0x435913 114#define CYGETWAIT 0x435913
114 115
@@ -149,14 +150,12 @@ struct CYZ_BOOT_CTRL {
149 * architectures and compilers. 150 * architectures and compilers.
150 */ 151 */
151 152
152#if defined(__alpha__) 153#include <asm/types.h>
153typedef unsigned long ucdouble; /* 64 bits, unsigned */ 154
154typedef unsigned int uclong; /* 32 bits, unsigned */ 155typedef __u64 ucdouble; /* 64 bits, unsigned */
155#else 156typedef __u32 uclong; /* 32 bits, unsigned */
156typedef unsigned long uclong; /* 32 bits, unsigned */ 157typedef __u16 ucshort; /* 16 bits, unsigned */
157#endif 158typedef __u8 ucchar; /* 8 bits, unsigned */
158typedef unsigned short ucshort; /* 16 bits, unsigned */
159typedef unsigned char ucchar; /* 8 bits, unsigned */
160 159
161/* 160/*
162 * Memory Window Sizes 161 * Memory Window Sizes
@@ -174,24 +173,24 @@ typedef unsigned char ucchar; /* 8 bits, unsigned */
174 */ 173 */
175 174
176struct CUSTOM_REG { 175struct CUSTOM_REG {
177 uclong fpga_id; /* FPGA Identification Register */ 176 __u32 fpga_id; /* FPGA Identification Register */
178 uclong fpga_version; /* FPGA Version Number Register */ 177 __u32 fpga_version; /* FPGA Version Number Register */
179 uclong cpu_start; /* CPU start Register (write) */ 178 __u32 cpu_start; /* CPU start Register (write) */
180 uclong cpu_stop; /* CPU stop Register (write) */ 179 __u32 cpu_stop; /* CPU stop Register (write) */
181 uclong misc_reg; /* Miscelaneous Register */ 180 __u32 misc_reg; /* Miscelaneous Register */
182 uclong idt_mode; /* IDT mode Register */ 181 __u32 idt_mode; /* IDT mode Register */
183 uclong uart_irq_status; /* UART IRQ status Register */ 182 __u32 uart_irq_status; /* UART IRQ status Register */
184 uclong clear_timer0_irq; /* Clear timer interrupt Register */ 183 __u32 clear_timer0_irq; /* Clear timer interrupt Register */
185 uclong clear_timer1_irq; /* Clear timer interrupt Register */ 184 __u32 clear_timer1_irq; /* Clear timer interrupt Register */
186 uclong clear_timer2_irq; /* Clear timer interrupt Register */ 185 __u32 clear_timer2_irq; /* Clear timer interrupt Register */
187 uclong test_register; /* Test Register */ 186 __u32 test_register; /* Test Register */
188 uclong test_count; /* Test Count Register */ 187 __u32 test_count; /* Test Count Register */
189 uclong timer_select; /* Timer select register */ 188 __u32 timer_select; /* Timer select register */
190 uclong pr_uart_irq_status; /* Prioritized UART IRQ stat Reg */ 189 __u32 pr_uart_irq_status; /* Prioritized UART IRQ stat Reg */
191 uclong ram_wait_state; /* RAM wait-state Register */ 190 __u32 ram_wait_state; /* RAM wait-state Register */
192 uclong uart_wait_state; /* UART wait-state Register */ 191 __u32 uart_wait_state; /* UART wait-state Register */
193 uclong timer_wait_state; /* timer wait-state Register */ 192 __u32 timer_wait_state; /* timer wait-state Register */
194 uclong ack_wait_state; /* ACK wait State Register */ 193 __u32 ack_wait_state; /* ACK wait State Register */
195}; 194};
196 195
197/* 196/*
@@ -201,34 +200,34 @@ struct CUSTOM_REG {
201 */ 200 */
202 201
203struct RUNTIME_9060 { 202struct RUNTIME_9060 {
204 uclong loc_addr_range; /* 00h - Local Address Range */ 203 __u32 loc_addr_range; /* 00h - Local Address Range */
205 uclong loc_addr_base; /* 04h - Local Address Base */ 204 __u32 loc_addr_base; /* 04h - Local Address Base */
206 uclong loc_arbitr; /* 08h - Local Arbitration */ 205 __u32 loc_arbitr; /* 08h - Local Arbitration */
207 uclong endian_descr; /* 0Ch - Big/Little Endian Descriptor */ 206 __u32 endian_descr; /* 0Ch - Big/Little Endian Descriptor */
208 uclong loc_rom_range; /* 10h - Local ROM Range */ 207 __u32 loc_rom_range; /* 10h - Local ROM Range */
209 uclong loc_rom_base; /* 14h - Local ROM Base */ 208 __u32 loc_rom_base; /* 14h - Local ROM Base */
210 uclong loc_bus_descr; /* 18h - Local Bus descriptor */ 209 __u32 loc_bus_descr; /* 18h - Local Bus descriptor */
211 uclong loc_range_mst; /* 1Ch - Local Range for Master to PCI */ 210 __u32 loc_range_mst; /* 1Ch - Local Range for Master to PCI */
212 uclong loc_base_mst; /* 20h - Local Base for Master PCI */ 211 __u32 loc_base_mst; /* 20h - Local Base for Master PCI */
213 uclong loc_range_io; /* 24h - Local Range for Master IO */ 212 __u32 loc_range_io; /* 24h - Local Range for Master IO */
214 uclong pci_base_mst; /* 28h - PCI Base for Master PCI */ 213 __u32 pci_base_mst; /* 28h - PCI Base for Master PCI */
215 uclong pci_conf_io; /* 2Ch - PCI configuration for Master IO */ 214 __u32 pci_conf_io; /* 2Ch - PCI configuration for Master IO */
216 uclong filler1; /* 30h */ 215 __u32 filler1; /* 30h */
217 uclong filler2; /* 34h */ 216 __u32 filler2; /* 34h */
218 uclong filler3; /* 38h */ 217 __u32 filler3; /* 38h */
219 uclong filler4; /* 3Ch */ 218 __u32 filler4; /* 3Ch */
220 uclong mail_box_0; /* 40h - Mail Box 0 */ 219 __u32 mail_box_0; /* 40h - Mail Box 0 */
221 uclong mail_box_1; /* 44h - Mail Box 1 */ 220 __u32 mail_box_1; /* 44h - Mail Box 1 */
222 uclong mail_box_2; /* 48h - Mail Box 2 */ 221 __u32 mail_box_2; /* 48h - Mail Box 2 */
223 uclong mail_box_3; /* 4Ch - Mail Box 3 */ 222 __u32 mail_box_3; /* 4Ch - Mail Box 3 */
224 uclong filler5; /* 50h */ 223 __u32 filler5; /* 50h */
225 uclong filler6; /* 54h */ 224 __u32 filler6; /* 54h */
226 uclong filler7; /* 58h */ 225 __u32 filler7; /* 58h */
227 uclong filler8; /* 5Ch */ 226 __u32 filler8; /* 5Ch */
228 uclong pci_doorbell; /* 60h - PCI to Local Doorbell */ 227 __u32 pci_doorbell; /* 60h - PCI to Local Doorbell */
229 uclong loc_doorbell; /* 64h - Local to PCI Doorbell */ 228 __u32 loc_doorbell; /* 64h - Local to PCI Doorbell */
230 uclong intr_ctrl_stat; /* 68h - Interrupt Control/Status */ 229 __u32 intr_ctrl_stat; /* 68h - Interrupt Control/Status */
231 uclong init_ctrl; /* 6Ch - EEPROM control, Init Control, etc */ 230 __u32 init_ctrl; /* 6Ch - EEPROM control, Init Control, etc */
232}; 231};
233 232
234/* Values for the Local Base Address re-map register */ 233/* Values for the Local Base Address re-map register */
@@ -270,8 +269,8 @@ struct RUNTIME_9060 {
270#define ZF_TINACT ZF_TINACT_DEF 269#define ZF_TINACT ZF_TINACT_DEF
271 270
272struct FIRM_ID { 271struct FIRM_ID {
273 uclong signature; /* ZFIRM/U signature */ 272 __u32 signature; /* ZFIRM/U signature */
274 uclong zfwctrl_addr; /* pointer to ZFW_CTRL structure */ 273 __u32 zfwctrl_addr; /* pointer to ZFW_CTRL structure */
275}; 274};
276 275
277/* Op. System id */ 276/* Op. System id */
@@ -408,24 +407,24 @@ struct FIRM_ID {
408 */ 407 */
409 408
410struct CH_CTRL { 409struct CH_CTRL {
411 uclong op_mode; /* operation mode */ 410 __u32 op_mode; /* operation mode */
412 uclong intr_enable; /* interrupt masking */ 411 __u32 intr_enable; /* interrupt masking */
413 uclong sw_flow; /* SW flow control */ 412 __u32 sw_flow; /* SW flow control */
414 uclong flow_status; /* output flow status */ 413 __u32 flow_status; /* output flow status */
415 uclong comm_baud; /* baud rate - numerically specified */ 414 __u32 comm_baud; /* baud rate - numerically specified */
416 uclong comm_parity; /* parity */ 415 __u32 comm_parity; /* parity */
417 uclong comm_data_l; /* data length/stop */ 416 __u32 comm_data_l; /* data length/stop */
418 uclong comm_flags; /* other flags */ 417 __u32 comm_flags; /* other flags */
419 uclong hw_flow; /* HW flow control */ 418 __u32 hw_flow; /* HW flow control */
420 uclong rs_control; /* RS-232 outputs */ 419 __u32 rs_control; /* RS-232 outputs */
421 uclong rs_status; /* RS-232 inputs */ 420 __u32 rs_status; /* RS-232 inputs */
422 uclong flow_xon; /* xon char */ 421 __u32 flow_xon; /* xon char */
423 uclong flow_xoff; /* xoff char */ 422 __u32 flow_xoff; /* xoff char */
424 uclong hw_overflow; /* hw overflow counter */ 423 __u32 hw_overflow; /* hw overflow counter */
425 uclong sw_overflow; /* sw overflow counter */ 424 __u32 sw_overflow; /* sw overflow counter */
426 uclong comm_error; /* frame/parity error counter */ 425 __u32 comm_error; /* frame/parity error counter */
427 uclong ichar; 426 __u32 ichar;
428 uclong filler[7]; 427 __u32 filler[7];
429}; 428};
430 429
431 430
@@ -435,18 +434,18 @@ struct CH_CTRL {
435 */ 434 */
436 435
437struct BUF_CTRL { 436struct BUF_CTRL {
438 uclong flag_dma; /* buffers are in Host memory */ 437 __u32 flag_dma; /* buffers are in Host memory */
439 uclong tx_bufaddr; /* address of the tx buffer */ 438 __u32 tx_bufaddr; /* address of the tx buffer */
440 uclong tx_bufsize; /* tx buffer size */ 439 __u32 tx_bufsize; /* tx buffer size */
441 uclong tx_threshold; /* tx low water mark */ 440 __u32 tx_threshold; /* tx low water mark */
442 uclong tx_get; /* tail index tx buf */ 441 __u32 tx_get; /* tail index tx buf */
443 uclong tx_put; /* head index tx buf */ 442 __u32 tx_put; /* head index tx buf */
444 uclong rx_bufaddr; /* address of the rx buffer */ 443 __u32 rx_bufaddr; /* address of the rx buffer */
445 uclong rx_bufsize; /* rx buffer size */ 444 __u32 rx_bufsize; /* rx buffer size */
446 uclong rx_threshold; /* rx high water mark */ 445 __u32 rx_threshold; /* rx high water mark */
447 uclong rx_get; /* tail index rx buf */ 446 __u32 rx_get; /* tail index rx buf */
448 uclong rx_put; /* head index rx buf */ 447 __u32 rx_put; /* head index rx buf */
449 uclong filler[5]; /* filler to align structures */ 448 __u32 filler[5]; /* filler to align structures */
450}; 449};
451 450
452/* 451/*
@@ -457,27 +456,27 @@ struct BUF_CTRL {
457struct BOARD_CTRL { 456struct BOARD_CTRL {
458 457
459 /* static info provided by the on-board CPU */ 458 /* static info provided by the on-board CPU */
460 uclong n_channel; /* number of channels */ 459 __u32 n_channel; /* number of channels */
461 uclong fw_version; /* firmware version */ 460 __u32 fw_version; /* firmware version */
462 461
463 /* static info provided by the driver */ 462 /* static info provided by the driver */
464 uclong op_system; /* op_system id */ 463 __u32 op_system; /* op_system id */
465 uclong dr_version; /* driver version */ 464 __u32 dr_version; /* driver version */
466 465
467 /* board control area */ 466 /* board control area */
468 uclong inactivity; /* inactivity control */ 467 __u32 inactivity; /* inactivity control */
469 468
470 /* host to FW commands */ 469 /* host to FW commands */
471 uclong hcmd_channel; /* channel number */ 470 __u32 hcmd_channel; /* channel number */
472 uclong hcmd_param; /* pointer to parameters */ 471 __u32 hcmd_param; /* pointer to parameters */
473 472
474 /* FW to Host commands */ 473 /* FW to Host commands */
475 uclong fwcmd_channel; /* channel number */ 474 __u32 fwcmd_channel; /* channel number */
476 uclong fwcmd_param; /* pointer to parameters */ 475 __u32 fwcmd_param; /* pointer to parameters */
477 uclong zf_int_queue_addr; /* offset for INT_QUEUE structure */ 476 __u32 zf_int_queue_addr; /* offset for INT_QUEUE structure */
478 477
479 /* filler so the structures are aligned */ 478 /* filler so the structures are aligned */
480 uclong filler[6]; 479 __u32 filler[6];
481}; 480};
482 481
483/* Host Interrupt Queue */ 482/* Host Interrupt Queue */
@@ -506,11 +505,10 @@ struct ZFW_CTRL {
506/****************** ****************** *******************/ 505/****************** ****************** *******************/
507#endif 506#endif
508 507
508#ifdef __KERNEL__
509
509/* Per card data structure */ 510/* Per card data structure */
510struct resource;
511struct cyclades_card { 511struct cyclades_card {
512 unsigned long base_phys;
513 unsigned long ctl_phys;
514 void __iomem *base_addr; 512 void __iomem *base_addr;
515 void __iomem *ctl_addr; 513 void __iomem *ctl_addr;
516 int irq; 514 int irq;
@@ -519,33 +517,18 @@ struct cyclades_card {
519 int nports; /* Number of ports in the card */ 517 int nports; /* Number of ports in the card */
520 int bus_index; /* address shift - 0 for ISA, 1 for PCI */ 518 int bus_index; /* address shift - 0 for ISA, 1 for PCI */
521 int intr_enabled; /* FW Interrupt flag - 0 disabled, 1 enabled */ 519 int intr_enabled; /* FW Interrupt flag - 0 disabled, 1 enabled */
522 struct pci_dev *pdev;
523#ifdef __KERNEL__
524 spinlock_t card_lock; 520 spinlock_t card_lock;
525#else 521 struct cyclades_port *ports;
526 unsigned long filler;
527#endif
528}; 522};
529 523
530struct cyclades_chip {
531 int filler;
532};
533
534
535#ifdef __KERNEL__
536
537/*************************************** 524/***************************************
538 * Memory access functions/macros * 525 * Memory access functions/macros *
539 * (required to support Alpha systems) * 526 * (required to support Alpha systems) *
540 ***************************************/ 527 ***************************************/
541 528
542#define cy_writeb(port,val) {writeb((val),(port)); mb();} 529#define cy_writeb(port,val) do { writeb((val), (port)); mb(); } while (0)
543#define cy_writew(port,val) {writew((val),(port)); mb();} 530#define cy_writew(port,val) do { writew((val), (port)); mb(); } while (0)
544#define cy_writel(port,val) {writel((val),(port)); mb();} 531#define cy_writel(port,val) do { writel((val), (port)); mb(); } while (0)
545
546#define cy_readb(port) readb(port)
547#define cy_readw(port) readw(port)
548#define cy_readl(port) readl(port)
549 532
550/* 533/*
551 * Statistics counters 534 * Statistics counters
@@ -567,7 +550,7 @@ struct cyclades_icount {
567 550
568struct cyclades_port { 551struct cyclades_port {
569 int magic; 552 int magic;
570 int card; 553 struct cyclades_card *card;
571 int line; 554 int line;
572 int flags; /* defined in tty.h */ 555 int flags; /* defined in tty.h */
573 int type; /* UART type */ 556 int type; /* UART type */
@@ -587,7 +570,6 @@ struct cyclades_port {
587 int close_delay; 570 int close_delay;
588 unsigned short closing_wait; 571 unsigned short closing_wait;
589 unsigned long event; 572 unsigned long event;
590 unsigned long last_active;
591 int count; /* # of fd on device */ 573 int count; /* # of fd on device */
592 int breakon; 574 int breakon;
593 int breakoff; 575 int breakoff;
@@ -598,7 +580,6 @@ struct cyclades_port {
598 int xmit_cnt; 580 int xmit_cnt;
599 int default_threshold; 581 int default_threshold;
600 int default_timeout; 582 int default_timeout;
601 unsigned long jiffies[3];
602 unsigned long rflush_count; 583 unsigned long rflush_count;
603 struct cyclades_monitor mon; 584 struct cyclades_monitor mon;
604 struct cyclades_idle_stats idle_stats; 585 struct cyclades_idle_stats idle_stats;
@@ -606,7 +587,7 @@ struct cyclades_port {
606 struct work_struct tqueue; 587 struct work_struct tqueue;
607 wait_queue_head_t open_wait; 588 wait_queue_head_t open_wait;
608 wait_queue_head_t close_wait; 589 wait_queue_head_t close_wait;
609 wait_queue_head_t shutdown_wait; 590 struct completion shutdown_wait;
610 wait_queue_head_t delta_msr_wait; 591 wait_queue_head_t delta_msr_wait;
611 int throttle; 592 int throttle;
612}; 593};