Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 36654
b: refs/heads/master
c: a2025e7
h: refs/heads/master
v: v3
  • Loading branch information
Dirk Opfer authored and Russell King committed Sep 27, 2006
1 parent 5bd7ed9 commit 2a65c89
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 23 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: 8d48427ecb0639593ccf14e807479b7873254ccb
refs/heads/master: a2025e7f73ae5eab0a25dad88c60aba67e3ae690
29 changes: 18 additions & 11 deletions trunk/arch/arm/common/locomo.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,13 @@ static struct locomo_dev_info locomo_devices[] = {
.offset = 0,
.length = 0,
},
{
.devid = LOCOMO_DEVID_SPI,
.irq = {},
.name = "locomo-spi",
.offset = LOCOMO_SPI,
.length = 0x30,
},
};


Expand Down Expand Up @@ -374,7 +381,7 @@ static void locomo_spi_handler(unsigned int irq, struct irqdesc *desc,
struct irqdesc *d;
void __iomem *mapbase = get_irq_chipdata(irq);

req = locomo_readl(mapbase + LOCOMO_SPIIR) & 0x000F;
req = locomo_readl(mapbase + LOCOMO_SPI + LOCOMO_SPIIR) & 0x000F;
if (req) {
irq = LOCOMO_IRQ_SPI_START;
d = irq_desc + irq;
Expand All @@ -391,35 +398,35 @@ static void locomo_spi_ack_irq(unsigned int irq)
{
void __iomem *mapbase = get_irq_chipdata(irq);
unsigned int r;
r = locomo_readl(mapbase + LOCOMO_SPIWE);
r = locomo_readl(mapbase + LOCOMO_SPI + LOCOMO_SPIWE);
r |= (0x0001 << (irq - LOCOMO_IRQ_SPI_START));
locomo_writel(r, mapbase + LOCOMO_SPIWE);
locomo_writel(r, mapbase + LOCOMO_SPI + LOCOMO_SPIWE);

r = locomo_readl(mapbase + LOCOMO_SPIIS);
r = locomo_readl(mapbase + LOCOMO_SPI + LOCOMO_SPIIS);
r &= ~(0x0001 << (irq - LOCOMO_IRQ_SPI_START));
locomo_writel(r, mapbase + LOCOMO_SPIIS);
locomo_writel(r, mapbase + LOCOMO_SPI + LOCOMO_SPIIS);

r = locomo_readl(mapbase + LOCOMO_SPIWE);
r = locomo_readl(mapbase + LOCOMO_SPI + LOCOMO_SPIWE);
r &= ~(0x0001 << (irq - LOCOMO_IRQ_SPI_START));
locomo_writel(r, mapbase + LOCOMO_SPIWE);
locomo_writel(r, mapbase + LOCOMO_SPI + LOCOMO_SPIWE);
}

static void locomo_spi_mask_irq(unsigned int irq)
{
void __iomem *mapbase = get_irq_chipdata(irq);
unsigned int r;
r = locomo_readl(mapbase + LOCOMO_SPIIE);
r = locomo_readl(mapbase + LOCOMO_SPI + LOCOMO_SPIIE);
r &= ~(0x0001 << (irq - LOCOMO_IRQ_SPI_START));
locomo_writel(r, mapbase + LOCOMO_SPIIE);
locomo_writel(r, mapbase + LOCOMO_SPI + LOCOMO_SPIIE);
}

static void locomo_spi_unmask_irq(unsigned int irq)
{
void __iomem *mapbase = get_irq_chipdata(irq);
unsigned int r;
r = locomo_readl(mapbase + LOCOMO_SPIIE);
r = locomo_readl(mapbase + LOCOMO_SPI + LOCOMO_SPIIE);
r |= (0x0001 << (irq - LOCOMO_IRQ_SPI_START));
locomo_writel(r, mapbase + LOCOMO_SPIIE);
locomo_writel(r, mapbase + LOCOMO_SPI + LOCOMO_SPIIE);
}

static struct irq_chip locomo_spi_chip = {
Expand Down
24 changes: 13 additions & 11 deletions trunk/include/asm-arm/hardware/locomo.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,18 @@
#define LOCOMO_DAC_SDAOEB 0x01 /* SDA pin output data */

/* SPI interface */
#define LOCOMO_SPIMD 0x60 /* SPI mode setting */
#define LOCOMO_SPICT 0x64 /* SPI mode control */
#define LOCOMO_SPIST 0x68 /* SPI status */
#define LOCOMO_SPIIS 0x70 /* SPI interrupt status */
#define LOCOMO_SPIWE 0x74 /* SPI interrupt status write enable */
#define LOCOMO_SPIIE 0x78 /* SPI interrupt enable */
#define LOCOMO_SPIIR 0x7c /* SPI interrupt request */
#define LOCOMO_SPITD 0x80 /* SPI transfer data write */
#define LOCOMO_SPIRD 0x84 /* SPI receive data read */
#define LOCOMO_SPITS 0x88 /* SPI transfer data shift */
#define LOCOMO_SPIRS 0x8C /* SPI receive data shift */
#define LOCOMO_SPI 0x60
#define LOCOMO_SPIMD 0x00 /* SPI mode setting */
#define LOCOMO_SPICT 0x04 /* SPI mode control */
#define LOCOMO_SPIST 0x08 /* SPI status */
#define LOCOMO_SPIIS 0x10 /* SPI interrupt status */
#define LOCOMO_SPIWE 0x14 /* SPI interrupt status write enable */
#define LOCOMO_SPIIE 0x18 /* SPI interrupt enable */
#define LOCOMO_SPIIR 0x1c /* SPI interrupt request */
#define LOCOMO_SPITD 0x20 /* SPI transfer data write */
#define LOCOMO_SPIRD 0x24 /* SPI receive data read */
#define LOCOMO_SPITS 0x28 /* SPI transfer data shift */
#define LOCOMO_SPIRS 0x2C /* SPI receive data shift */
#define LOCOMO_SPI_TEND (1 << 3) /* Transfer end bit */
#define LOCOMO_SPI_OVRN (1 << 2) /* Over Run bit */
#define LOCOMO_SPI_RFW (1 << 1) /* write buffer bit */
Expand Down Expand Up @@ -161,6 +162,7 @@ extern struct bus_type locomo_bus_type;
#define LOCOMO_DEVID_AUDIO 3
#define LOCOMO_DEVID_LED 4
#define LOCOMO_DEVID_UART 5
#define LOCOMO_DEVID_SPI 6

struct locomo_dev {
struct device dev;
Expand Down

0 comments on commit 2a65c89

Please sign in to comment.