Ignore:
Timestamp:
2009-03-12T17:54:24Z (16 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
3a1c048
Parents:
a0e1b48
Message:

update for the new scheme of wiring device drivers to keyboard/serial modules

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/genarch/include/drivers/z8530/z8530.h

    ra0e1b48 r3c79afe  
    2727 */
    2828
    29 /** @addtogroup genarch 
     29/** @addtogroup genarch
    3030 * @{
    3131 */
    3232/**
    3333 * @file
    34  * @brief       Headers for Zilog 8530 serial controller.
     34 * @brief Headers for Zilog 8530 serial controller.
    3535 */
    3636
     
    4242#include <console/chardev.h>
    4343
    44 #define WR0     0
    45 #define WR1     1
    46 #define WR2     2
    47 #define WR3     3
    48 #define WR4     4
    49 #define WR5     5
    50 #define WR6     6
    51 #define WR7     7
    52 #define WR8     8
    53 #define WR9     9
    54 #define WR10    10
    55 #define WR11    11
    56 #define WR12    12
    57 #define WR13    13
    58 #define WR14    14
    59 #define WR15    15
     44#define WR0   0
     45#define WR1   1
     46#define WR2   2
     47#define WR3   3
     48#define WR4   4
     49#define WR5   5
     50#define WR6   6
     51#define WR7   7
     52#define WR8   8
     53#define WR9   9
     54#define WR10  10
     55#define WR11  11
     56#define WR12  12
     57#define WR13  13
     58#define WR14  14
     59#define WR15  15
    6060
    61 #define RR0     0
    62 #define RR1     1
    63 #define RR2     2
    64 #define RR3     3
    65 #define RR8     8
    66 #define RR10    10
    67 #define RR12    12
    68 #define RR13    13
    69 #define RR14    14
    70 #define RR15    15
     61#define RR0   0
     62#define RR1   1
     63#define RR2   2
     64#define RR3   3
     65#define RR8   8
     66#define RR10  10
     67#define RR12  12
     68#define RR13  13
     69#define RR14  14
     70#define RR15  15
    7171
    7272/** Reset pending TX interrupt. */
    73 #define WR0_TX_IP_RST   (0x5 << 3)
    74 #define WR0_ERR_RST     (0x6 << 3)
     73#define WR0_TX_IP_RST  (0x5 << 3)
     74#define WR0_ERR_RST    (0x6 << 3)
    7575
    7676/** Receive Interrupts Disabled. */
    77 #define WR1_RID         (0x0 << 3)
     77#define WR1_RID     (0x0 << 3)
    7878/** Receive Interrupt on First Character or Special Condition. */
    79 #define WR1_RIFCSC      (0x1 << 3)
     79#define WR1_RIFCSC  (0x1 << 3)
    8080/** Interrupt on All Receive Characters or Special Conditions. */
    81 #define WR1_IARCSC      (0x2 << 3)
     81#define WR1_IARCSC  (0x2 << 3)
    8282/** Receive Interrupt on Special Condition. */
    83 #define WR1_RISC        (0x3 << 3)
     83#define WR1_RISC    (0x3 << 3)
    8484/** Parity Is Special Condition. */
    85 #define WR1_PISC        (0x1 << 2)
     85#define WR1_PISC    (0x1 << 2)
    8686
    8787/** Rx Enable. */
    88 #define WR3_RX_ENABLE   (0x1 << 0)
     88#define WR3_RX_ENABLE  (0x1 << 0)
    8989/** 8-bits per character. */
    90 #define WR3_RX8BITSCH   (0x3 << 6)
     90#define WR3_RX8BITSCH  (0x3 << 6)
    9191
    9292/** Master Interrupt Enable. */
    93 #define WR9_MIE         (0x1 << 3)
     93#define WR9_MIE  (0x1 << 3)
    9494
    9595/** Receive Character Available. */
    96 #define RR0_RCA         (0x1 << 0)
     96#define RR0_RCA  (0x1 << 0)
    9797
    9898/** z8530's registers. */
    99 struct z8530 {
     99typedef struct {
    100100        union {
    101101                ioport8_t ctl_b;
     
    111111        uint8_t pad3;
    112112        ioport8_t data_a;
    113 } __attribute__ ((packed));
    114 typedef struct z8530 z8530_t;
     113} __attribute__ ((packed)) z8530_t;
    115114
    116115/** Structure representing the z8530 device. */
     
    119118        irq_t irq;
    120119        z8530_t *z8530;
    121         chardev_t *devout;
     120        indev_t kbrdin;
    122121} z8530_instance_t;
    123122
    124 extern bool z8530_init(z8530_t *, devno_t, inr_t, cir_t, void *, chardev_t *);
    125 extern irq_ownership_t z8530_claim(irq_t *);
    126 extern void z8530_irq_handler(irq_t *);
     123extern devin_t *z8530_init(z8530_t *, devno_t, inr_t, cir_t, void *);
    127124
    128125#endif
Note: See TracChangeset for help on using the changeset viewer.