Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f647a274 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge master.kernel.org:/home/rmk/linux-2.6-arm

parents 75043cb5 2966207c
Loading
Loading
Loading
Loading
+67 −18
Original line number Diff line number Diff line
@@ -40,6 +40,8 @@
#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;

@@ -238,33 +240,38 @@ void __init ixp2000_init_time(unsigned long tick_rate)
/*************************************************************************
 * GPIO helpers
 *************************************************************************/
static unsigned long GPIO_IRQ_rising_edge;
static unsigned long GPIO_IRQ_falling_edge;
static unsigned long GPIO_IRQ_rising_edge;
static unsigned long GPIO_IRQ_level_low;
static unsigned long GPIO_IRQ_level_high;

void gpio_line_config(int line, int style)
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)
{
	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);
		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));
	}
		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);
	}
	local_irq_restore(flags);
}

@@ -285,9 +292,50 @@ 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)));
}

@@ -302,6 +350,7 @@ 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
@@ -384,7 +433,7 @@ void __init ixp2000_init_irq(void)

	/*
	 * GPIO IRQs are invalid until someone sets the interrupt mode
	 * by calling gpio_line_set();
	 * by calling set_irq_type().
	 */
	for (irq = IRQ_IXP2000_GPIO0; irq <= IRQ_IXP2000_GPIO7; irq++) {
		set_irq_chip(irq, &ixp2000_GPIO_irq_chip);
+8 −0
Original line number Diff line number Diff line
@@ -141,7 +141,15 @@ 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)
+3 −3
Original line number Diff line number Diff line
@@ -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   1   1   0	r/o	r/o
 *	  11x0   1   1   0	r/o	r/o
 *	  110x   0   1   0	r/w	r/o
 *	  11x0   0   1   0	r/w	r/o
 *	  1111   0   1   1	r/w	r/w
 */
ENTRY(cpu_v6_set_pte)
@@ -150,7 +150,7 @@ ENTRY(cpu_v6_set_pte)
	tst	r1, #L_PTE_USER
	orrne	r2, r2, #AP1 | nG
	tstne	r2, #APX
	eorne	r2, r2, #AP0
	bicne	r2, r2, #APX | AP0

	tst	r1, #L_PTE_YOUNG
	biceq	r2, r2, #APX | AP1 | AP0
+2 −1
Original line number Diff line number Diff line
@@ -33,7 +33,8 @@
#include <linux/i2c.h>
#include <linux/i2c-algo-bit.h>

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

static inline int ixp2000_scl_pin(void *data)
{
+12 −19
Original line number Diff line number Diff line
/*
 * include/asm-arm/arch-ixp2000/ixp2000-gpio.h
 * include/asm-arm/arch-ixp2000/gpio.h
 *
 * Copyright (C) 2002 Intel Corporation.
 *
@@ -16,26 +16,18 @@
 * Use this instead of directly setting the GPIO registers.
 * GPIOs may also be used as GPIOs (e.g. for emulating i2c/smb)
 */
#ifndef _ASM_ARCH_IXP2000_GPIO_H_
#define _ASM_ARCH_IXP2000_GPIO_H_
#ifndef __ASM_ARCH_GPIO_H
#define __ASM_ARCH_GPIO_H

#ifndef __ASSEMBLY__
#define GPIO_OUT			0x0
#define GPIO_IN				0x80

#define GPIO_IN				0
#define GPIO_OUT			1

#define IXP2000_GPIO_LOW		0
#define IXP2000_GPIO_HIGH		1

#define GPIO_NO_EDGES           	0
#define GPIO_FALLING_EDGE       	1
#define GPIO_RISING_EDGE        	2
#define GPIO_BOTH_EDGES         	3
#define GPIO_LEVEL_LOW          	4
#define GPIO_LEVEL_HIGH         	8

extern void set_GPIO_IRQ_edge(int gpio_nr, int edge);
extern void set_GPIO_IRQ_level(int gpio_nr, int level);
extern void gpio_line_config(int line, int style);
extern void gpio_line_config(int line, int direction);

static inline int gpio_line_get(int line)
{
@@ -45,11 +37,12 @@ static inline int gpio_line_get(int line)
static inline void gpio_line_set(int line, int value)
{
	if (value == IXP2000_GPIO_HIGH) {
		ixp_reg_write(IXP2000_GPIO_POSR, BIT(line));
	} else if (value == IXP2000_GPIO_LOW)
		ixp_reg_write(IXP2000_GPIO_POCR, BIT(line));
		ixp2000_reg_write(IXP2000_GPIO_POSR, 1 << line);
	} else if (value == IXP2000_GPIO_LOW) {
		ixp2000_reg_write(IXP2000_GPIO_POCR, 1 << line);
	}
}

#endif /* !__ASSEMBLY__ */
#endif /* ASM_ARCH_IXP2000_GPIO_H_ */

#endif /* ASM_ARCH_IXP2000_GPIO_H_ */
Loading