#endif
};
-#define ZILOG_CHANNEL_FROM_PORT(PORT) ((struct zilog_channel *)((PORT)->membase))
+#define ZILOG_CHANNEL_FROM_PORT(PORT) ((struct zilog_channel __iomem *)((PORT)->membase))
#define UART_ZILOG(PORT) ((struct uart_sunzilog_port *)(PORT))
#define ZS_IS_KEYB(UP) ((UP)->flags & SUNZILOG_FLAG_CONS_KEYB)
* The port lock must be held and local IRQs must be disabled
* when {read,write}_zsreg is invoked.
*/
-static unsigned char read_zsreg(struct zilog_channel *channel,
+static unsigned char read_zsreg(struct zilog_channel __iomem *channel,
unsigned char reg)
{
unsigned char retval;
return retval;
}
-static void write_zsreg(struct zilog_channel *channel,
+static void write_zsreg(struct zilog_channel __iomem *channel,
unsigned char reg, unsigned char value)
{
sbus_writeb(reg, &channel->control);
ZSDELAY();
}
-static void sunzilog_clear_fifo(struct zilog_channel *channel)
+static void sunzilog_clear_fifo(struct zilog_channel __iomem *channel)
{
int i;
/* This function must only be called when the TX is not busy. The UART
* port lock must be held and local interrupts disabled.
*/
-static void __load_zsregs(struct zilog_channel *channel, unsigned char *regs)
+static void __load_zsregs(struct zilog_channel __iomem *channel, unsigned char *regs)
{
int i;
* The UART port lock must be held and local interrupts disabled.
*/
static void sunzilog_maybe_update_regs(struct uart_sunzilog_port *up,
- struct zilog_channel *channel)
+ struct zilog_channel __iomem *channel)
{
if (!ZS_REGS_HELD(up)) {
if (ZS_TX_ACTIVE(up)) {
static struct tty_struct *
sunzilog_receive_chars(struct uart_sunzilog_port *up,
- struct zilog_channel *channel,
+ struct zilog_channel __iomem *channel,
struct pt_regs *regs)
{
struct tty_struct *tty;
}
static void sunzilog_status_handle(struct uart_sunzilog_port *up,
- struct zilog_channel *channel,
+ struct zilog_channel __iomem *channel,
struct pt_regs *regs)
{
unsigned char status;
}
static void sunzilog_transmit_chars(struct uart_sunzilog_port *up,
- struct zilog_channel *channel)
+ struct zilog_channel __iomem *channel)
{
struct circ_buf *xmit;
struct uart_sunzilog_port *up = dev_id;
while (up) {
- struct zilog_channel *channel
+ struct zilog_channel __iomem *channel
= ZILOG_CHANNEL_FROM_PORT(&up->port);
struct tty_struct *tty;
unsigned char r3;
*/
static __inline__ unsigned char sunzilog_read_channel_status(struct uart_port *port)
{
- struct zilog_channel *channel;
+ struct zilog_channel __iomem *channel;
unsigned long flags;
unsigned char status;
static void sunzilog_set_mctrl(struct uart_port *port, unsigned int mctrl)
{
struct uart_sunzilog_port *up = (struct uart_sunzilog_port *) port;
- struct zilog_channel *channel = ZILOG_CHANNEL_FROM_PORT(port);
+ struct zilog_channel __iomem *channel = ZILOG_CHANNEL_FROM_PORT(port);
unsigned char set_bits, clear_bits;
set_bits = clear_bits = 0;
static void sunzilog_start_tx(struct uart_port *port, unsigned int tty_start)
{
struct uart_sunzilog_port *up = (struct uart_sunzilog_port *) port;
- struct zilog_channel *channel = ZILOG_CHANNEL_FROM_PORT(port);
+ struct zilog_channel __iomem *channel = ZILOG_CHANNEL_FROM_PORT(port);
unsigned char status;
up->flags |= SUNZILOG_FLAG_TX_ACTIVE;
static void sunzilog_stop_rx(struct uart_port *port)
{
struct uart_sunzilog_port *up = UART_ZILOG(port);
- struct zilog_channel *channel;
+ struct zilog_channel __iomem *channel;
if (ZS_IS_CONS(up))
return;
static void sunzilog_enable_ms(struct uart_port *port)
{
struct uart_sunzilog_port *up = (struct uart_sunzilog_port *) port;
- struct zilog_channel *channel = ZILOG_CHANNEL_FROM_PORT(port);
+ struct zilog_channel __iomem *channel = ZILOG_CHANNEL_FROM_PORT(port);
unsigned char new_reg;
new_reg = up->curregs[R15] | (DCDIE | SYNCIE | CTSIE);
static void sunzilog_break_ctl(struct uart_port *port, int break_state)
{
struct uart_sunzilog_port *up = (struct uart_sunzilog_port *) port;
- struct zilog_channel *channel = ZILOG_CHANNEL_FROM_PORT(port);
+ struct zilog_channel __iomem *channel = ZILOG_CHANNEL_FROM_PORT(port);
unsigned char set_bits, clear_bits, new_reg;
unsigned long flags;
static void __sunzilog_startup(struct uart_sunzilog_port *up)
{
- struct zilog_channel *channel;
+ struct zilog_channel __iomem *channel;
channel = ZILOG_CHANNEL_FROM_PORT(&up->port);
up->prev_status = sbus_readb(&channel->control);
static void sunzilog_shutdown(struct uart_port *port)
{
struct uart_sunzilog_port *up = UART_ZILOG(port);
- struct zilog_channel *channel;
+ struct zilog_channel __iomem *channel;
unsigned long flags;
if (ZS_IS_CONS(up))
sunzilog_maybe_update_regs(up, ZILOG_CHANNEL_FROM_PORT(port));
+ uart_update_timeout(port, termios->c_cflag, baud);
+
spin_unlock_irqrestore(&up->port.lock, flags);
}
};
static struct uart_sunzilog_port *sunzilog_port_table;
-static struct zilog_layout **sunzilog_chip_regs;
+static struct zilog_layout __iomem **sunzilog_chip_regs;
static struct uart_sunzilog_port *sunzilog_irq_chain;
static int zilog_irq = -1;
static void __init sunzilog_alloc_tables(void)
{
- sunzilog_port_table = (struct uart_sunzilog_port *)
+ sunzilog_port_table =
alloc_one_table(NUM_CHANNELS * sizeof(struct uart_sunzilog_port));
- sunzilog_chip_regs = (struct zilog_layout **)
- alloc_one_table(NUM_SUNZILOG * sizeof(struct zilog_layout *));
+ sunzilog_chip_regs =
+ alloc_one_table(NUM_SUNZILOG * sizeof(struct zilog_layout __iomem *));
if (sunzilog_port_table == NULL || sunzilog_chip_regs == NULL) {
prom_printf("SunZilog: Cannot allocate tables.\n");
/* We used to attempt to use the address property of the Zilog device node
* but that totally is not necessary on sparc64.
*/
-static struct zilog_layout * __init get_zs_sun4u(int chip, int zsnode)
+static struct zilog_layout __iomem * __init get_zs_sun4u(int chip, int zsnode)
{
unsigned long mapped_addr;
unsigned int sun4u_ino;
}
}
- return (struct zilog_layout *) mapped_addr;
+ return (struct zilog_layout __iomem *) mapped_addr;
}
#else /* CONFIG_SPARC64 */
* XXX The sun4d case is utterly screwed: it tries to re-walk the tree
* (for the 3rd time) in order to find bootbus and cpu. Streamline it.
*/
-static struct zilog_layout * __init get_zs_sun4cmd(int chip, int node)
+static struct zilog_layout __iomem * __init get_zs_sun4cmd(int chip, int node)
{
struct linux_prom_irqs irq_info[2];
- unsigned long mapped_addr = 0;
+ void __iomem *mapped_addr = NULL;
int zsnode, cpunode, bbnode;
struct linux_prom_registers zsreg[4];
struct resource res;
prom_halt();
}
- return (struct zilog_layout *) mapped_addr;
+ return (struct zilog_layout __iomem *) mapped_addr;
}
#endif /* !(CONFIG_SPARC64) */
/* Get the address of the registers for SunZilog instance CHIP. */
-static struct zilog_layout * __init get_zs(int chip, int node)
+static struct zilog_layout __iomem * __init get_zs(int chip, int node)
{
if (chip < 0 || chip >= NUM_SUNZILOG) {
prom_printf("SunZilog: Illegal chip number %d in get_zs.\n", chip);
zilog_irq = 12;
res.end = (res.start + (8 - 1));
res.flags = IORESOURCE_IO;
- return (struct zilog_layout *) sbus_ioremap(&res, 0, 8, "SunZilog");
+ return sbus_ioremap(&res, 0, 8, "SunZilog");
}
return get_zs_sun4cmd(chip, node);
#define ZS_PUT_CHAR_MAX_DELAY 2000 /* 10 ms */
-static void sunzilog_put_char(struct zilog_channel *channel, unsigned char ch)
+static void sunzilog_put_char(struct zilog_channel __iomem *channel, unsigned char ch)
{
int loops = ZS_PUT_CHAR_MAX_DELAY;
#ifdef CONFIG_SERIO
-static spinlock_t sunzilog_serio_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(sunzilog_serio_lock);
static int sunzilog_serio_write(struct serio *serio, unsigned char ch)
{
static void __init sunzilog_prepare(void)
{
struct uart_sunzilog_port *up;
- struct zilog_layout *rp;
+ struct zilog_layout __iomem *rp;
int channel, chip;
/*
for (chip = 0; chip < NUM_SUNZILOG; chip++) {
rp = sunzilog_chip_regs[chip];
- up[(chip * 2) + 0].port.membase = (char *) &rp->channelA;
- up[(chip * 2) + 1].port.membase = (char *) &rp->channelB;
+ up[(chip * 2) + 0].port.membase = (void __iomem *)&rp->channelA;
+ up[(chip * 2) + 1].port.membase = (void __iomem *)&rp->channelB;
/* Channel A */
up[(chip * 2) + 0].port.iotype = SERIAL_IO_MEM;
for (i = 0; i < NUM_CHANNELS; i++) {
struct uart_sunzilog_port *up = &sunzilog_port_table[i];
- struct zilog_channel *channel = ZILOG_CHANNEL_FROM_PORT(&up->port);
+ struct zilog_channel __iomem *channel = ZILOG_CHANNEL_FROM_PORT(&up->port);
unsigned long flags;
int baud, brg;
}
}
-static struct zilog_layout * __init get_zs(int chip, int node);
+static struct zilog_layout __iomem * __init get_zs(int chip, int node);
static void __init sunzilog_scan_probe(struct zs_probe_scan *t, int node)
{
ret = uart_register_driver(&sunzilog_reg);
if (ret == 0) {
+ sunzilog_console_init();
for (i = 0; i < NUM_CHANNELS; i++) {
struct uart_sunzilog_port *up = &sunzilog_port_table[i];
sunzilog_alloc_tables();
sunzilog_ports_init();
- sunzilog_console_init();
return 0;
}