Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 3181
b: refs/heads/master
c: 0a8b80c
h: refs/heads/master
i:
  3179: 94057a6
v: v3
  • Loading branch information
Russell King authored and Russell King committed Jun 24, 2005
1 parent e64c2cd commit ba35af4
Show file tree
Hide file tree
Showing 20 changed files with 115 additions and 243 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f647a27417d2adc43d8c96d3d6f837422fbc076e
refs/heads/master: 0a8b80c52f44a6e84206618a8a450ba13a5809dc
85 changes: 18 additions & 67 deletions trunk/arch/arm/mach-ixp2000/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@
#include <asm/mach/time.h>
#include <asm/mach/irq.h>

#include <asm/arch/gpio.h>

static DEFINE_SPINLOCK(ixp2000_slowport_lock);
static unsigned long ixp2000_slowport_irq_flags;

Expand Down Expand Up @@ -181,7 +179,7 @@ static int ixp2000_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)

/* clear timer 1 */
ixp2000_reg_write(IXP2000_T1_CLR, 1);

while ((next_jiffy_time - *missing_jiffy_timer_csr) > ticks_per_jiffy) {
timer_tick(regs);
next_jiffy_time -= ticks_per_jiffy;
Expand Down Expand Up @@ -240,40 +238,35 @@ void __init ixp2000_init_time(unsigned long tick_rate)
/*************************************************************************
* GPIO helpers
*************************************************************************/
static unsigned long GPIO_IRQ_falling_edge;
static unsigned long GPIO_IRQ_rising_edge;
static unsigned long GPIO_IRQ_falling_edge;
static unsigned long GPIO_IRQ_level_low;
static unsigned long GPIO_IRQ_level_high;

static void update_gpio_int_csrs(void)
{
ixp2000_reg_write(IXP2000_GPIO_FEDR, GPIO_IRQ_falling_edge);
ixp2000_reg_write(IXP2000_GPIO_REDR, GPIO_IRQ_rising_edge);
ixp2000_reg_write(IXP2000_GPIO_LSLR, GPIO_IRQ_level_low);
ixp2000_reg_write(IXP2000_GPIO_LSHR, GPIO_IRQ_level_high);
}

void gpio_line_config(int line, int direction)
void gpio_line_config(int line, int style)
{
unsigned long flags;

local_irq_save(flags);
if (direction == GPIO_OUT) {
irq_desc[line + IRQ_IXP2000_GPIO0].valid = 0;

if(style == GPIO_OUT) {
/* if it's an output, it ain't an interrupt anymore */
ixp2000_reg_write(IXP2000_GPIO_PDSR, (1 << line));
GPIO_IRQ_falling_edge &= ~(1 << line);
GPIO_IRQ_rising_edge &= ~(1 << line);
GPIO_IRQ_level_low &= ~(1 << line);
GPIO_IRQ_level_high &= ~(1 << line);
update_gpio_int_csrs();

ixp2000_reg_write(IXP2000_GPIO_PDSR, 1 << line);
} else if (direction == GPIO_IN) {
ixp2000_reg_write(IXP2000_GPIO_PDCR, 1 << line);
ixp2000_reg_write(IXP2000_GPIO_FEDR, GPIO_IRQ_falling_edge);
ixp2000_reg_write(IXP2000_GPIO_REDR, GPIO_IRQ_rising_edge);
ixp2000_reg_write(IXP2000_GPIO_LSHR, GPIO_IRQ_level_high);
ixp2000_reg_write(IXP2000_GPIO_LSLR, GPIO_IRQ_level_low);
irq_desc[line+IRQ_IXP2000_GPIO0].valid = 0;
} else if(style == GPIO_IN) {
ixp2000_reg_write(IXP2000_GPIO_PDCR, (1 << line));
}

local_irq_restore(flags);
}
}


/*************************************************************************
Expand All @@ -292,50 +285,9 @@ static void ixp2000_GPIO_irq_handler(unsigned int irq, struct irqdesc *desc, str
}
}

static int ixp2000_GPIO_irq_type(unsigned int irq, unsigned int type)
{
int line = irq - IRQ_IXP2000_GPIO0;

/*
* First, configure this GPIO line as an input.
*/
ixp2000_reg_write(IXP2000_GPIO_PDCR, 1 << line);

/*
* Then, set the proper trigger type.
*/
if (type & IRQT_FALLING)
GPIO_IRQ_falling_edge |= 1 << line;
else
GPIO_IRQ_falling_edge &= ~(1 << line);
if (type & IRQT_RISING)
GPIO_IRQ_rising_edge |= 1 << line;
else
GPIO_IRQ_rising_edge &= ~(1 << line);
if (type & IRQT_LOW)
GPIO_IRQ_level_low |= 1 << line;
else
GPIO_IRQ_level_low &= ~(1 << line);
if (type & IRQT_HIGH)
GPIO_IRQ_level_high |= 1 << line;
else
GPIO_IRQ_level_high &= ~(1 << line);
update_gpio_int_csrs();

/*
* Finally, mark the corresponding IRQ as valid.
*/
irq_desc[irq].valid = 1;

return 0;
}

static void ixp2000_GPIO_irq_mask_ack(unsigned int irq)
{
ixp2000_reg_write(IXP2000_GPIO_INCR, (1 << (irq - IRQ_IXP2000_GPIO0)));

ixp2000_reg_write(IXP2000_GPIO_EDSR, (1 << (irq - IRQ_IXP2000_GPIO0)));
ixp2000_reg_write(IXP2000_GPIO_LDSR, (1 << (irq - IRQ_IXP2000_GPIO0)));
ixp2000_reg_write(IXP2000_GPIO_INST, (1 << (irq - IRQ_IXP2000_GPIO0)));
}

Expand All @@ -350,7 +302,6 @@ static void ixp2000_GPIO_irq_unmask(unsigned int irq)
}

static struct irqchip ixp2000_GPIO_irq_chip = {
.type = ixp2000_GPIO_irq_type,
.ack = ixp2000_GPIO_irq_mask_ack,
.mask = ixp2000_GPIO_irq_mask,
.unmask = ixp2000_GPIO_irq_unmask
Expand Down Expand Up @@ -387,7 +338,7 @@ static void ixp2000_irq_mask(unsigned int irq)

static void ixp2000_irq_unmask(unsigned int irq)
{
ixp2000_reg_write(IXP2000_IRQ_ENABLE_SET, (1 << irq));
ixp2000_reg_write(IXP2000_IRQ_ENABLE_SET, (1 << irq));
}

static struct irqchip ixp2000_irq_chip = {
Expand Down Expand Up @@ -424,16 +375,16 @@ void __init ixp2000_init_irq(void)
* our mask/unmask code much simpler.
*/
for (irq = IRQ_IXP2000_SOFT_INT; irq <= IRQ_IXP2000_THDB3; irq++) {
if ((1 << irq) & IXP2000_VALID_IRQ_MASK) {
if((1 << irq) & IXP2000_VALID_IRQ_MASK) {
set_irq_chip(irq, &ixp2000_irq_chip);
set_irq_handler(irq, do_level_IRQ);
set_irq_flags(irq, IRQF_VALID);
} else set_irq_flags(irq, 0);
}

/*
* GPIO IRQs are invalid until someone sets the interrupt mode
* by calling set_irq_type().
* by calling gpio_line_set();
*/
for (irq = IRQ_IXP2000_GPIO0; irq <= IRQ_IXP2000_GPIO7; irq++) {
set_irq_chip(irq, &ixp2000_GPIO_irq_chip);
Expand Down
8 changes: 0 additions & 8 deletions trunk/arch/arm/mach-ixp4xx/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,15 +141,7 @@ static struct map_desc ixp4xx_io_desc[] __initdata = {
.physical = IXP4XX_PCI_CFG_BASE_PHYS,
.length = IXP4XX_PCI_CFG_REGION_SIZE,
.type = MT_DEVICE
},
#ifdef CONFIG_DEBUG_LL
{ /* Debug UART mapping */
.virtual = IXP4XX_DEBUG_UART_BASE_VIRT,
.physical = IXP4XX_DEBUG_UART_BASE_PHYS,
.length = IXP4XX_DEBUG_UART_REGION_SIZE,
.type = MT_DEVICE
}
#endif
};

void __init ixp4xx_map_io(void)
Expand Down
6 changes: 3 additions & 3 deletions trunk/arch/arm/mm/proc-v6.S
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ ENTRY(cpu_v6_switch_mm)
* 100x 1 0 1 r/o no acc
* 10x0 1 0 1 r/o no acc
* 1011 0 0 1 r/w no acc
* 110x 0 1 0 r/w r/o
* 11x0 0 1 0 r/w r/o
* 110x 1 1 0 r/o r/o
* 11x0 1 1 0 r/o r/o
* 1111 0 1 1 r/w r/w
*/
ENTRY(cpu_v6_set_pte)
Expand All @@ -150,7 +150,7 @@ ENTRY(cpu_v6_set_pte)
tst r1, #L_PTE_USER
orrne r2, r2, #AP1 | nG
tstne r2, #APX
bicne r2, r2, #APX | AP0
eorne r2, r2, #AP0

tst r1, #L_PTE_YOUNG
biceq r2, r2, #APX | AP1 | AP0
Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/i2c/busses/i2c-ixp2000.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@
#include <linux/i2c.h>
#include <linux/i2c-algo-bit.h>

#include <asm/hardware.h> /* Pick up IXP2000-specific bits */
#include <asm/arch/gpio.h>
#include <asm/hardware.h> /* Pick up IXP42000-specific bits */

static inline int ixp2000_scl_pin(void *data)
{
Expand Down
10 changes: 5 additions & 5 deletions trunk/drivers/serial/8250.c
Original file line number Diff line number Diff line change
Expand Up @@ -1682,22 +1682,22 @@ serial8250_set_termios(struct uart_port *port, struct termios *termios,

switch (termios->c_cflag & CSIZE) {
case CS5:
cval = 0x00;
cval = UART_LCR_WLEN5;
break;
case CS6:
cval = 0x01;
cval = UART_LCR_WLEN6;
break;
case CS7:
cval = 0x02;
cval = UART_LCR_WLEN7;
break;
default:
case CS8:
cval = 0x03;
cval = UART_LCR_WLEN8;
break;
}

if (termios->c_cflag & CSTOPB)
cval |= 0x04;
cval |= UART_LCR_STOP;
if (termios->c_cflag & PARENB)
cval |= UART_LCR_PARITY;
if (!(termios->c_cflag & PARODD))
Expand Down
10 changes: 5 additions & 5 deletions trunk/drivers/serial/au1x00_uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -773,22 +773,22 @@ serial8250_set_termios(struct uart_port *port, struct termios *termios,

switch (termios->c_cflag & CSIZE) {
case CS5:
cval = 0x00;
cval = UART_LCR_WLEN5;
break;
case CS6:
cval = 0x01;
cval = UART_LCR_WLEN6;
break;
case CS7:
cval = 0x02;
cval = UART_LCR_WLEN7;
break;
default:
case CS8:
cval = 0x03;
cval = UART_LCR_WLEN8;
break;
}

if (termios->c_cflag & CSTOPB)
cval |= 0x04;
cval |= UART_LCR_STOP;
if (termios->c_cflag & PARENB)
cval |= UART_LCR_PARITY;
if (!(termios->c_cflag & PARODD))
Expand Down
10 changes: 5 additions & 5 deletions trunk/drivers/serial/m32r_sio.c
Original file line number Diff line number Diff line change
Expand Up @@ -724,22 +724,22 @@ static void m32r_sio_set_termios(struct uart_port *port,

switch (termios->c_cflag & CSIZE) {
case CS5:
cval = 0x00;
cval = UART_LCR_WLEN5;
break;
case CS6:
cval = 0x01;
cval = UART_LCR_WLEN6;
break;
case CS7:
cval = 0x02;
cval = UART_LCR_WLEN7;
break;
default:
case CS8:
cval = 0x03;
cval = UART_LCR_WLEN8;
break;
}

if (termios->c_cflag & CSTOPB)
cval |= 0x04;
cval |= UART_LCR_STOP;
if (termios->c_cflag & PARENB)
cval |= UART_LCR_PARITY;
if (!(termios->c_cflag & PARODD))
Expand Down
10 changes: 5 additions & 5 deletions trunk/drivers/serial/pxa.c
Original file line number Diff line number Diff line change
Expand Up @@ -455,22 +455,22 @@ serial_pxa_set_termios(struct uart_port *port, struct termios *termios,

switch (termios->c_cflag & CSIZE) {
case CS5:
cval = 0x00;
cval = UART_LCR_WLEN5;
break;
case CS6:
cval = 0x01;
cval = UART_LCR_WLEN6;
break;
case CS7:
cval = 0x02;
cval = UART_LCR_WLEN7;
break;
default:
case CS8:
cval = 0x03;
cval = UART_LCR_WLEN8;
break;
}

if (termios->c_cflag & CSTOPB)
cval |= 0x04;
cval |= UART_LCR_STOP;
if (termios->c_cflag & PARENB)
cval |= UART_LCR_PARITY;
if (!(termios->c_cflag & PARODD))
Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/qnx4/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ static int qnx4_readdir(struct file *filp, void *dirent, filldir_t filldir)
ino = blknum * QNX4_INODES_PER_BLOCK + ix - 1;
else {
le = (struct qnx4_link_info*)de;
ino = ( le32_to_cpu(le->dl_inode_blk) - 1 ) *
ino = ( le->dl_inode_blk - 1 ) *
QNX4_INODES_PER_BLOCK +
le->dl_inode_ndx;
}
Expand Down
4 changes: 2 additions & 2 deletions trunk/fs/qnx4/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ unsigned long qnx4_block_map( struct inode *inode, long iblock )
struct buffer_head *bh = NULL;
struct qnx4_xblk *xblk = NULL;
struct qnx4_inode_entry *qnx4_inode = qnx4_raw_inode(inode);
u16 nxtnt = le16_to_cpu(qnx4_inode->di_num_xtnts);
qnx4_nxtnt_t nxtnt = le16_to_cpu(qnx4_inode->di_num_xtnts);

if ( iblock < le32_to_cpu(qnx4_inode->di_first_xtnt.xtnt_size) ) {
// iblock is in the first extent. This is easy.
Expand Down Expand Up @@ -372,7 +372,7 @@ static int qnx4_fill_super(struct super_block *s, void *data, int silent)
printk("qnx4: unable to read the superblock\n");
goto outnobh;
}
if ( le32_to_cpup((__le32*) bh->b_data) != QNX4_SUPER_MAGIC ) {
if ( le32_to_cpu( *(__u32*)bh->b_data ) != QNX4_SUPER_MAGIC ) {
if (!silent)
printk("qnx4: wrong fsid in superblock.\n");
goto out;
Expand Down
Loading

0 comments on commit ba35af4

Please sign in to comment.