Skip to content
Snippets Groups Projects
Commit 9e4db1c3 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'platforms' of git://git.linaro.org/people/rmk/linux-arm

Pull ARM platform updates from Russell King:
 "This covers platform stuff for platforms I have a direct interest in
  (iow, I have the hardware).  Essentially:
   - as we no longer support any other Acorn platforms other than RiscPC
     anymore, we can collect all that code into mach-rpc.
   - convert Acorn expansion card stuff to use IRQ allocation functions,
     and get rid of NO_IRQ from there.
   - cleanups to the ebsa110 platform to move some private stuff out of
     its header files.
   - large amount of SA11x0 updates:
   - conversion of private DMA implementation to DMA engine support
     (this actually gives us greater flexibility in drivers over the old
     API.)
   - re-worked ucb1x00 updates - convert to genirq, remove sa11x0
     dependencies, fix various minor issues
   - move platform specific sa11x0 framebuffer data into platform files
     in arch/arm instead of keeping this in the driver itself
   - update sa11x0 IrDA driver for DMA engine, and allow it to use DMA
     for SIR transmissions as well as FIR
   - rework sa1111 support for genirq, and irq allocation
   - fix sa1111 IRQ support so it works again
   - use sparse IRQ support

  After this, I have one more pull request remaining from my current
  set, which I think is going to be the most problematical as it
  generates 8 conflicts."

Fixed up the trivial conflict in arch/arm/mach-rpc/Makefile as per
Russell.

* 'platforms' of git://git.linaro.org/people/rmk/linux-arm: (125 commits)
  ARM: 7343/1: sa11x0: convert to sparse IRQ
  ARM: 7342/2: sa1100: prepare for sparse irq conversion
  ARM: 7341/1: input: prepare jornada720 keyboard and ts for sa11x0 sparse irq
  ARM: 7340/1: rtc: sa1100: include mach/irqs.h instead of asm/irq.h
  ARM: sa11x0: remove unused DMA controller definitions
  ARM: sa11x0: remove old SoC private DMA driver
  USB: sa1111: add hcd .reset method
  USB: sa1111: add OHCI shutdown methods
  USB: sa1111: reorganize ohci-sa1111.c
  USB: sa1111: get rid of nasty printk(KERN_DEBUG "%s: ...", __FILE__)
  USB: sa1111: sparse and checkpatch cleanups
  ARM: sa11x0: don't static map sa1111
  ARM: sa1111: use dev_err() rather than printk()
  ARM: sa1111: cleanup sub-device registration and unregistration
  ARM: sa1111: only setup DMA for DMA capable devices
  ARM: sa1111: register sa1111 devices with dmabounce in bus notifier
  ARM: sa1111: move USB interface register definitions to ohci-sa1111.c
  ARM: sa1111: move PCMCIA interface register definitions to sa1111_generic.c
  ARM: sa1111: move PS/2 interface register definitions to sa1111p2.c
  ARM: sa1111: delete unused physical GPIO register definitions
  ...
parents de8856d2 aae528d9
No related merge requests found
Showing
with 456 additions and 485 deletions
...@@ -738,7 +738,6 @@ config ARCH_RPC ...@@ -738,7 +738,6 @@ config ARCH_RPC
bool "RiscPC" bool "RiscPC"
select ARCH_ACORN select ARCH_ACORN
select FIQ select FIQ
select TIMER_ACORN
select ARCH_MAY_HAVE_PC_FDC select ARCH_MAY_HAVE_PC_FDC
select HAVE_PATA_PLATFORM select HAVE_PATA_PLATFORM
select ISA_DMA_API select ISA_DMA_API
...@@ -767,6 +766,7 @@ config ARCH_SA1100 ...@@ -767,6 +766,7 @@ config ARCH_SA1100
select ARCH_REQUIRE_GPIOLIB select ARCH_REQUIRE_GPIOLIB
select HAVE_IDE select HAVE_IDE
select NEED_MACH_MEMORY_H select NEED_MACH_MEMORY_H
select SPARSE_IRQ
help help
Support for StrongARM 11x0 based boards. Support for StrongARM 11x0 based boards.
......
...@@ -35,9 +35,6 @@ config DMABOUNCE ...@@ -35,9 +35,6 @@ config DMABOUNCE
bool bool
select ZONE_DMA select ZONE_DMA
config TIMER_ACORN
bool
config SHARP_LOCOMO config SHARP_LOCOMO
bool bool
......
...@@ -9,7 +9,6 @@ obj-$(CONFIG_PL330) += pl330.o ...@@ -9,7 +9,6 @@ obj-$(CONFIG_PL330) += pl330.o
obj-$(CONFIG_SA1111) += sa1111.o obj-$(CONFIG_SA1111) += sa1111.o
obj-$(CONFIG_PCI_HOST_VIA82C505) += via82c505.o obj-$(CONFIG_PCI_HOST_VIA82C505) += via82c505.o
obj-$(CONFIG_DMABOUNCE) += dmabounce.o obj-$(CONFIG_DMABOUNCE) += dmabounce.o
obj-$(CONFIG_TIMER_ACORN) += time-acorn.o
obj-$(CONFIG_SHARP_LOCOMO) += locomo.o obj-$(CONFIG_SHARP_LOCOMO) += locomo.o
obj-$(CONFIG_SHARP_PARAM) += sharpsl_param.o obj-$(CONFIG_SHARP_PARAM) += sharpsl_param.o
obj-$(CONFIG_SHARP_SCOOP) += scoop.o obj-$(CONFIG_SHARP_SCOOP) += scoop.o
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
*/ */
#include <linux/module.h> #include <linux/module.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/irq.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/errno.h> #include <linux/errno.h>
...@@ -28,9 +29,8 @@ ...@@ -28,9 +29,8 @@
#include <linux/io.h> #include <linux/io.h>
#include <mach/hardware.h> #include <mach/hardware.h>
#include <asm/mach-types.h>
#include <asm/irq.h>
#include <asm/mach/irq.h> #include <asm/mach/irq.h>
#include <asm/mach-types.h>
#include <asm/sizes.h> #include <asm/sizes.h>
#include <asm/hardware/sa1111.h> #include <asm/hardware/sa1111.h>
...@@ -86,8 +86,10 @@ ...@@ -86,8 +86,10 @@
#define IRQ_S1_CD_VALID (52) #define IRQ_S1_CD_VALID (52)
#define IRQ_S0_BVD1_STSCHG (53) #define IRQ_S0_BVD1_STSCHG (53)
#define IRQ_S1_BVD1_STSCHG (54) #define IRQ_S1_BVD1_STSCHG (54)
#define SA1111_IRQ_NR (55)
extern void __init sa1110_mb_enable(void); extern void sa1110_mb_enable(void);
extern void sa1110_mb_disable(void);
/* /*
* We keep the following data for the overall SA1111. Note that the * We keep the following data for the overall SA1111. Note that the
...@@ -104,6 +106,7 @@ struct sa1111 { ...@@ -104,6 +106,7 @@ struct sa1111 {
int irq_base; /* base for cascaded on-chip IRQs */ int irq_base; /* base for cascaded on-chip IRQs */
spinlock_t lock; spinlock_t lock;
void __iomem *base; void __iomem *base;
struct sa1111_platform_data *pdata;
#ifdef CONFIG_PM #ifdef CONFIG_PM
void *saved_state; void *saved_state;
#endif #endif
...@@ -118,6 +121,7 @@ static struct sa1111 *g_sa1111; ...@@ -118,6 +121,7 @@ static struct sa1111 *g_sa1111;
struct sa1111_dev_info { struct sa1111_dev_info {
unsigned long offset; unsigned long offset;
unsigned long skpcr_mask; unsigned long skpcr_mask;
bool dma;
unsigned int devid; unsigned int devid;
unsigned int irq[6]; unsigned int irq[6];
}; };
...@@ -126,6 +130,7 @@ static struct sa1111_dev_info sa1111_devices[] = { ...@@ -126,6 +130,7 @@ static struct sa1111_dev_info sa1111_devices[] = {
{ {
.offset = SA1111_USB, .offset = SA1111_USB,
.skpcr_mask = SKPCR_UCLKEN, .skpcr_mask = SKPCR_UCLKEN,
.dma = true,
.devid = SA1111_DEVID_USB, .devid = SA1111_DEVID_USB,
.irq = { .irq = {
IRQ_USBPWR, IRQ_USBPWR,
...@@ -139,6 +144,7 @@ static struct sa1111_dev_info sa1111_devices[] = { ...@@ -139,6 +144,7 @@ static struct sa1111_dev_info sa1111_devices[] = {
{ {
.offset = 0x0600, .offset = 0x0600,
.skpcr_mask = SKPCR_I2SCLKEN | SKPCR_L3CLKEN, .skpcr_mask = SKPCR_I2SCLKEN | SKPCR_L3CLKEN,
.dma = true,
.devid = SA1111_DEVID_SAC, .devid = SA1111_DEVID_SAC,
.irq = { .irq = {
AUDXMTDMADONEA, AUDXMTDMADONEA,
...@@ -155,7 +161,7 @@ static struct sa1111_dev_info sa1111_devices[] = { ...@@ -155,7 +161,7 @@ static struct sa1111_dev_info sa1111_devices[] = {
{ {
.offset = SA1111_KBD, .offset = SA1111_KBD,
.skpcr_mask = SKPCR_PTCLKEN, .skpcr_mask = SKPCR_PTCLKEN,
.devid = SA1111_DEVID_PS2, .devid = SA1111_DEVID_PS2_KBD,
.irq = { .irq = {
IRQ_TPRXINT, IRQ_TPRXINT,
IRQ_TPTXINT IRQ_TPTXINT
...@@ -164,7 +170,7 @@ static struct sa1111_dev_info sa1111_devices[] = { ...@@ -164,7 +170,7 @@ static struct sa1111_dev_info sa1111_devices[] = {
{ {
.offset = SA1111_MSE, .offset = SA1111_MSE,
.skpcr_mask = SKPCR_PMCLKEN, .skpcr_mask = SKPCR_PMCLKEN,
.devid = SA1111_DEVID_PS2, .devid = SA1111_DEVID_PS2_MSE,
.irq = { .irq = {
IRQ_MSRXINT, IRQ_MSRXINT,
IRQ_MSTXINT IRQ_MSTXINT
...@@ -434,16 +440,28 @@ static struct irq_chip sa1111_high_chip = { ...@@ -434,16 +440,28 @@ static struct irq_chip sa1111_high_chip = {
.irq_set_wake = sa1111_wake_highirq, .irq_set_wake = sa1111_wake_highirq,
}; };
static void sa1111_setup_irq(struct sa1111 *sachip) static int sa1111_setup_irq(struct sa1111 *sachip, unsigned irq_base)
{ {
void __iomem *irqbase = sachip->base + SA1111_INTC; void __iomem *irqbase = sachip->base + SA1111_INTC;
unsigned int irq; unsigned i, irq;
int ret;
/* /*
* We're guaranteed that this region hasn't been taken. * We're guaranteed that this region hasn't been taken.
*/ */
request_mem_region(sachip->phys + SA1111_INTC, 512, "irq"); request_mem_region(sachip->phys + SA1111_INTC, 512, "irq");
ret = irq_alloc_descs(-1, irq_base, SA1111_IRQ_NR, -1);
if (ret <= 0) {
dev_err(sachip->dev, "unable to allocate %u irqs: %d\n",
SA1111_IRQ_NR, ret);
if (ret == 0)
ret = -EINVAL;
return ret;
}
sachip->irq_base = ret;
/* disable all IRQs */ /* disable all IRQs */
sa1111_writel(0, irqbase + SA1111_INTEN0); sa1111_writel(0, irqbase + SA1111_INTEN0);
sa1111_writel(0, irqbase + SA1111_INTEN1); sa1111_writel(0, irqbase + SA1111_INTEN1);
...@@ -463,14 +481,16 @@ static void sa1111_setup_irq(struct sa1111 *sachip) ...@@ -463,14 +481,16 @@ static void sa1111_setup_irq(struct sa1111 *sachip)
sa1111_writel(~0, irqbase + SA1111_INTSTATCLR0); sa1111_writel(~0, irqbase + SA1111_INTSTATCLR0);
sa1111_writel(~0, irqbase + SA1111_INTSTATCLR1); sa1111_writel(~0, irqbase + SA1111_INTSTATCLR1);
for (irq = IRQ_GPAIN0; irq <= SSPROR; irq++) { for (i = IRQ_GPAIN0; i <= SSPROR; i++) {
irq = sachip->irq_base + i;
irq_set_chip_and_handler(irq, &sa1111_low_chip, irq_set_chip_and_handler(irq, &sa1111_low_chip,
handle_edge_irq); handle_edge_irq);
irq_set_chip_data(irq, sachip); irq_set_chip_data(irq, sachip);
set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
} }
for (irq = AUDXMTDMADONEA; irq <= IRQ_S1_BVD1_STSCHG; irq++) { for (i = AUDXMTDMADONEA; i <= IRQ_S1_BVD1_STSCHG; i++) {
irq = sachip->irq_base + i;
irq_set_chip_and_handler(irq, &sa1111_high_chip, irq_set_chip_and_handler(irq, &sa1111_high_chip,
handle_edge_irq); handle_edge_irq);
irq_set_chip_data(irq, sachip); irq_set_chip_data(irq, sachip);
...@@ -483,6 +503,11 @@ static void sa1111_setup_irq(struct sa1111 *sachip) ...@@ -483,6 +503,11 @@ static void sa1111_setup_irq(struct sa1111 *sachip)
irq_set_irq_type(sachip->irq, IRQ_TYPE_EDGE_RISING); irq_set_irq_type(sachip->irq, IRQ_TYPE_EDGE_RISING);
irq_set_handler_data(sachip->irq, sachip); irq_set_handler_data(sachip->irq, sachip);
irq_set_chained_handler(sachip->irq, sa1111_irq_handler); irq_set_chained_handler(sachip->irq, sa1111_irq_handler);
dev_info(sachip->dev, "Providing IRQ%u-%u\n",
sachip->irq_base, sachip->irq_base + SA1111_IRQ_NR - 1);
return 0;
} }
/* /*
...@@ -581,41 +606,10 @@ sa1111_configure_smc(struct sa1111 *sachip, int sdram, unsigned int drac, ...@@ -581,41 +606,10 @@ sa1111_configure_smc(struct sa1111 *sachip, int sdram, unsigned int drac,
} }
#endif #endif
#ifdef CONFIG_DMABOUNCE
/*
* According to the "Intel StrongARM SA-1111 Microprocessor Companion
* Chip Specification Update" (June 2000), erratum #7, there is a
* significant bug in the SA1111 SDRAM shared memory controller. If
* an access to a region of memory above 1MB relative to the bank base,
* it is important that address bit 10 _NOT_ be asserted. Depending
* on the configuration of the RAM, bit 10 may correspond to one
* of several different (processor-relative) address bits.
*
* This routine only identifies whether or not a given DMA address
* is susceptible to the bug.
*
* This should only get called for sa1111_device types due to the
* way we configure our device dma_masks.
*/
static int sa1111_needs_bounce(struct device *dev, dma_addr_t addr, size_t size)
{
/*
* Section 4.6 of the "Intel StrongARM SA-1111 Development Module
* User's Guide" mentions that jumpers R51 and R52 control the
* target of SA-1111 DMA (either SDRAM bank 0 on Assabet, or
* SDRAM bank 1 on Neponset). The default configuration selects
* Assabet, so any address in bank 1 is necessarily invalid.
*/
return (machine_is_assabet() || machine_is_pfs168()) &&
(addr >= 0xc8000000 || (addr + size) >= 0xc8000000);
}
#endif
static void sa1111_dev_release(struct device *_dev) static void sa1111_dev_release(struct device *_dev)
{ {
struct sa1111_dev *dev = SA1111_DEV(_dev); struct sa1111_dev *dev = SA1111_DEV(_dev);
release_resource(&dev->res);
kfree(dev); kfree(dev);
} }
...@@ -624,67 +618,58 @@ sa1111_init_one_child(struct sa1111 *sachip, struct resource *parent, ...@@ -624,67 +618,58 @@ sa1111_init_one_child(struct sa1111 *sachip, struct resource *parent,
struct sa1111_dev_info *info) struct sa1111_dev_info *info)
{ {
struct sa1111_dev *dev; struct sa1111_dev *dev;
unsigned i;
int ret; int ret;
dev = kzalloc(sizeof(struct sa1111_dev), GFP_KERNEL); dev = kzalloc(sizeof(struct sa1111_dev), GFP_KERNEL);
if (!dev) { if (!dev) {
ret = -ENOMEM; ret = -ENOMEM;
goto out; goto err_alloc;
} }
device_initialize(&dev->dev);
dev_set_name(&dev->dev, "%4.4lx", info->offset); dev_set_name(&dev->dev, "%4.4lx", info->offset);
dev->devid = info->devid; dev->devid = info->devid;
dev->dev.parent = sachip->dev; dev->dev.parent = sachip->dev;
dev->dev.bus = &sa1111_bus_type; dev->dev.bus = &sa1111_bus_type;
dev->dev.release = sa1111_dev_release; dev->dev.release = sa1111_dev_release;
dev->dev.coherent_dma_mask = sachip->dev->coherent_dma_mask;
dev->res.start = sachip->phys + info->offset; dev->res.start = sachip->phys + info->offset;
dev->res.end = dev->res.start + 511; dev->res.end = dev->res.start + 511;
dev->res.name = dev_name(&dev->dev); dev->res.name = dev_name(&dev->dev);
dev->res.flags = IORESOURCE_MEM; dev->res.flags = IORESOURCE_MEM;
dev->mapbase = sachip->base + info->offset; dev->mapbase = sachip->base + info->offset;
dev->skpcr_mask = info->skpcr_mask; dev->skpcr_mask = info->skpcr_mask;
memmove(dev->irq, info->irq, sizeof(dev->irq));
ret = request_resource(parent, &dev->res);
if (ret) {
printk("SA1111: failed to allocate resource for %s\n",
dev->res.name);
dev_set_name(&dev->dev, NULL);
kfree(dev);
goto out;
}
ret = device_register(&dev->dev); for (i = 0; i < ARRAY_SIZE(info->irq); i++)
if (ret) { dev->irq[i] = sachip->irq_base + info->irq[i];
release_resource(&dev->res);
kfree(dev);
goto out;
}
#ifdef CONFIG_DMABOUNCE
/* /*
* If the parent device has a DMA mask associated with it, * If the parent device has a DMA mask associated with it, and
* propagate it down to the children. * this child supports DMA, propagate it down to the children.
*/ */
if (sachip->dev->dma_mask) { if (info->dma && sachip->dev->dma_mask) {
dev->dma_mask = *sachip->dev->dma_mask; dev->dma_mask = *sachip->dev->dma_mask;
dev->dev.dma_mask = &dev->dma_mask; dev->dev.dma_mask = &dev->dma_mask;
dev->dev.coherent_dma_mask = sachip->dev->coherent_dma_mask;
}
if (dev->dma_mask != 0xffffffffUL) { ret = request_resource(parent, &dev->res);
ret = dmabounce_register_dev(&dev->dev, 1024, 4096, if (ret) {
sa1111_needs_bounce); dev_err(sachip->dev, "failed to allocate resource for %s\n",
if (ret) { dev->res.name);
dev_err(&dev->dev, "SA1111: Failed to register" goto err_resource;
" with dmabounce\n");
device_unregister(&dev->dev);
}
}
} }
#endif
out: ret = device_add(&dev->dev);
if (ret)
goto err_add;
return 0;
err_add:
release_resource(&dev->res);
err_resource:
put_device(&dev->dev);
err_alloc:
return ret; return ret;
} }
...@@ -698,16 +683,21 @@ sa1111_init_one_child(struct sa1111 *sachip, struct resource *parent, ...@@ -698,16 +683,21 @@ sa1111_init_one_child(struct sa1111 *sachip, struct resource *parent,
* Returns: * Returns:
* %-ENODEV device not found. * %-ENODEV device not found.
* %-EBUSY physical address already marked in-use. * %-EBUSY physical address already marked in-use.
* %-EINVAL no platform data passed
* %0 successful. * %0 successful.
*/ */
static int __devinit static int __devinit
__sa1111_probe(struct device *me, struct resource *mem, int irq) __sa1111_probe(struct device *me, struct resource *mem, int irq)
{ {
struct sa1111_platform_data *pd = me->platform_data;
struct sa1111 *sachip; struct sa1111 *sachip;
unsigned long id; unsigned long id;
unsigned int has_devs; unsigned int has_devs;
int i, ret = -ENODEV; int i, ret = -ENODEV;
if (!pd)
return -EINVAL;
sachip = kzalloc(sizeof(struct sa1111), GFP_KERNEL); sachip = kzalloc(sizeof(struct sa1111), GFP_KERNEL);
if (!sachip) if (!sachip)
return -ENOMEM; return -ENOMEM;
...@@ -727,6 +717,7 @@ __sa1111_probe(struct device *me, struct resource *mem, int irq) ...@@ -727,6 +717,7 @@ __sa1111_probe(struct device *me, struct resource *mem, int irq)
sachip->dev = me; sachip->dev = me;
dev_set_drvdata(sachip->dev, sachip); dev_set_drvdata(sachip->dev, sachip);
sachip->pdata = pd;
sachip->phys = mem->start; sachip->phys = mem->start;
sachip->irq = irq; sachip->irq = irq;
...@@ -759,6 +750,16 @@ __sa1111_probe(struct device *me, struct resource *mem, int irq) ...@@ -759,6 +750,16 @@ __sa1111_probe(struct device *me, struct resource *mem, int irq)
*/ */
sa1111_wake(sachip); sa1111_wake(sachip);
/*
* The interrupt controller must be initialised before any
* other device to ensure that the interrupts are available.
*/
if (sachip->irq != NO_IRQ) {
ret = sa1111_setup_irq(sachip, pd->irq_base);
if (ret)
goto err_unmap;
}
#ifdef CONFIG_ARCH_SA1100 #ifdef CONFIG_ARCH_SA1100
{ {
unsigned int val; unsigned int val;
...@@ -789,24 +790,14 @@ __sa1111_probe(struct device *me, struct resource *mem, int irq) ...@@ -789,24 +790,14 @@ __sa1111_probe(struct device *me, struct resource *mem, int irq)
} }
#endif #endif
/*
* The interrupt controller must be initialised before any
* other device to ensure that the interrupts are available.
*/
if (sachip->irq != NO_IRQ)
sa1111_setup_irq(sachip);
g_sa1111 = sachip; g_sa1111 = sachip;
has_devs = ~0; has_devs = ~0;
if (machine_is_assabet() || machine_is_jornada720() || if (pd)
machine_is_badge4()) has_devs &= ~pd->disable_devs;
has_devs &= ~(1 << 4);
else
has_devs &= ~(1 << 1);
for (i = 0; i < ARRAY_SIZE(sa1111_devices); i++) for (i = 0; i < ARRAY_SIZE(sa1111_devices); i++)
if (has_devs & (1 << i)) if (sa1111_devices[i].devid & has_devs)
sa1111_init_one_child(sachip, mem, &sa1111_devices[i]); sa1111_init_one_child(sachip, mem, &sa1111_devices[i]);
return 0; return 0;
...@@ -824,7 +815,10 @@ __sa1111_probe(struct device *me, struct resource *mem, int irq) ...@@ -824,7 +815,10 @@ __sa1111_probe(struct device *me, struct resource *mem, int irq)
static int sa1111_remove_one(struct device *dev, void *data) static int sa1111_remove_one(struct device *dev, void *data)
{ {
device_unregister(dev); struct sa1111_dev *sadev = SA1111_DEV(dev);
device_del(&sadev->dev);
release_resource(&sadev->res);
put_device(&sadev->dev);
return 0; return 0;
} }
...@@ -846,6 +840,7 @@ static void __sa1111_remove(struct sa1111 *sachip) ...@@ -846,6 +840,7 @@ static void __sa1111_remove(struct sa1111 *sachip)
if (sachip->irq != NO_IRQ) { if (sachip->irq != NO_IRQ) {
irq_set_chained_handler(sachip->irq, NULL); irq_set_chained_handler(sachip->irq, NULL);
irq_set_handler_data(sachip->irq, NULL); irq_set_handler_data(sachip->irq, NULL);
irq_free_descs(sachip->irq_base, SA1111_IRQ_NR);
release_mem_region(sachip->phys + SA1111_INTC, 512); release_mem_region(sachip->phys + SA1111_INTC, 512);
} }
...@@ -904,6 +899,9 @@ static int sa1111_suspend(struct platform_device *dev, pm_message_t state) ...@@ -904,6 +899,9 @@ static int sa1111_suspend(struct platform_device *dev, pm_message_t state)
save->skpwm0 = sa1111_readl(base + SA1111_SKPWM0); save->skpwm0 = sa1111_readl(base + SA1111_SKPWM0);
save->skpwm1 = sa1111_readl(base + SA1111_SKPWM1); save->skpwm1 = sa1111_readl(base + SA1111_SKPWM1);
sa1111_writel(0, sachip->base + SA1111_SKPWM0);
sa1111_writel(0, sachip->base + SA1111_SKPWM1);
base = sachip->base + SA1111_INTC; base = sachip->base + SA1111_INTC;
save->intpol0 = sa1111_readl(base + SA1111_INTPOL0); save->intpol0 = sa1111_readl(base + SA1111_INTPOL0);
save->intpol1 = sa1111_readl(base + SA1111_INTPOL1); save->intpol1 = sa1111_readl(base + SA1111_INTPOL1);
...@@ -919,13 +917,15 @@ static int sa1111_suspend(struct platform_device *dev, pm_message_t state) ...@@ -919,13 +917,15 @@ static int sa1111_suspend(struct platform_device *dev, pm_message_t state)
*/ */
val = sa1111_readl(sachip->base + SA1111_SKCR); val = sa1111_readl(sachip->base + SA1111_SKCR);
sa1111_writel(val | SKCR_SLEEP, sachip->base + SA1111_SKCR); sa1111_writel(val | SKCR_SLEEP, sachip->base + SA1111_SKCR);
sa1111_writel(0, sachip->base + SA1111_SKPWM0);
sa1111_writel(0, sachip->base + SA1111_SKPWM1);
clk_disable(sachip->clk); clk_disable(sachip->clk);
spin_unlock_irqrestore(&sachip->lock, flags); spin_unlock_irqrestore(&sachip->lock, flags);
#ifdef CONFIG_ARCH_SA1100
sa1110_mb_disable();
#endif
return 0; return 0;
} }
...@@ -966,6 +966,11 @@ static int sa1111_resume(struct platform_device *dev) ...@@ -966,6 +966,11 @@ static int sa1111_resume(struct platform_device *dev)
*/ */
sa1111_wake(sachip); sa1111_wake(sachip);
#ifdef CONFIG_ARCH_SA1100
/* Enable the memory bus request/grant signals */
sa1110_mb_enable();
#endif
/* /*
* Only lock for write ops. Also, sa1111_wake must be called with * Only lock for write ops. Also, sa1111_wake must be called with
* released spinlock! * released spinlock!
...@@ -1053,6 +1058,7 @@ static struct platform_driver sa1111_device_driver = { ...@@ -1053,6 +1058,7 @@ static struct platform_driver sa1111_device_driver = {
.resume = sa1111_resume, .resume = sa1111_resume,
.driver = { .driver = {
.name = "sa1111", .name = "sa1111",
.owner = THIS_MODULE,
}, },
}; };
...@@ -1238,16 +1244,23 @@ EXPORT_SYMBOL(sa1111_set_sleep_io); ...@@ -1238,16 +1244,23 @@ EXPORT_SYMBOL(sa1111_set_sleep_io);
* sa1111_enable_device - enable an on-chip SA1111 function block * sa1111_enable_device - enable an on-chip SA1111 function block
* @sadev: SA1111 function block device to enable * @sadev: SA1111 function block device to enable
*/ */
void sa1111_enable_device(struct sa1111_dev *sadev) int sa1111_enable_device(struct sa1111_dev *sadev)
{ {
struct sa1111 *sachip = sa1111_chip_driver(sadev); struct sa1111 *sachip = sa1111_chip_driver(sadev);
unsigned long flags; unsigned long flags;
unsigned int val; unsigned int val;
int ret = 0;
spin_lock_irqsave(&sachip->lock, flags); if (sachip->pdata && sachip->pdata->enable)
val = sa1111_readl(sachip->base + SA1111_SKPCR); ret = sachip->pdata->enable(sachip->pdata->data, sadev->devid);
sa1111_writel(val | sadev->skpcr_mask, sachip->base + SA1111_SKPCR);
spin_unlock_irqrestore(&sachip->lock, flags); if (ret == 0) {
spin_lock_irqsave(&sachip->lock, flags);
val = sa1111_readl(sachip->base + SA1111_SKPCR);
sa1111_writel(val | sadev->skpcr_mask, sachip->base + SA1111_SKPCR);
spin_unlock_irqrestore(&sachip->lock, flags);
}
return ret;
} }
EXPORT_SYMBOL(sa1111_enable_device); EXPORT_SYMBOL(sa1111_enable_device);
...@@ -1265,6 +1278,9 @@ void sa1111_disable_device(struct sa1111_dev *sadev) ...@@ -1265,6 +1278,9 @@ void sa1111_disable_device(struct sa1111_dev *sadev)
val = sa1111_readl(sachip->base + SA1111_SKPCR); val = sa1111_readl(sachip->base + SA1111_SKPCR);
sa1111_writel(val & ~sadev->skpcr_mask, sachip->base + SA1111_SKPCR); sa1111_writel(val & ~sadev->skpcr_mask, sachip->base + SA1111_SKPCR);
spin_unlock_irqrestore(&sachip->lock, flags); spin_unlock_irqrestore(&sachip->lock, flags);
if (sachip->pdata && sachip->pdata->disable)
sachip->pdata->disable(sachip->pdata->data, sadev->devid);
} }
EXPORT_SYMBOL(sa1111_disable_device); EXPORT_SYMBOL(sa1111_disable_device);
...@@ -1279,7 +1295,7 @@ static int sa1111_match(struct device *_dev, struct device_driver *_drv) ...@@ -1279,7 +1295,7 @@ static int sa1111_match(struct device *_dev, struct device_driver *_drv)
struct sa1111_dev *dev = SA1111_DEV(_dev); struct sa1111_dev *dev = SA1111_DEV(_dev);
struct sa1111_driver *drv = SA1111_DRV(_drv); struct sa1111_driver *drv = SA1111_DRV(_drv);
return dev->devid == drv->devid; return dev->devid & drv->devid;
} }
static int sa1111_bus_suspend(struct device *dev, pm_message_t state) static int sa1111_bus_suspend(struct device *dev, pm_message_t state)
...@@ -1304,6 +1320,14 @@ static int sa1111_bus_resume(struct device *dev) ...@@ -1304,6 +1320,14 @@ static int sa1111_bus_resume(struct device *dev)
return ret; return ret;
} }
static void sa1111_bus_shutdown(struct device *dev)
{
struct sa1111_driver *drv = SA1111_DRV(dev->driver);
if (drv && drv->shutdown)
drv->shutdown(SA1111_DEV(dev));
}
static int sa1111_bus_probe(struct device *dev) static int sa1111_bus_probe(struct device *dev)
{ {
struct sa1111_dev *sadev = SA1111_DEV(dev); struct sa1111_dev *sadev = SA1111_DEV(dev);
...@@ -1333,6 +1357,7 @@ struct bus_type sa1111_bus_type = { ...@@ -1333,6 +1357,7 @@ struct bus_type sa1111_bus_type = {
.remove = sa1111_bus_remove, .remove = sa1111_bus_remove,
.suspend = sa1111_bus_suspend, .suspend = sa1111_bus_suspend,
.resume = sa1111_bus_resume, .resume = sa1111_bus_resume,
.shutdown = sa1111_bus_shutdown,
}; };
EXPORT_SYMBOL(sa1111_bus_type); EXPORT_SYMBOL(sa1111_bus_type);
...@@ -1349,9 +1374,70 @@ void sa1111_driver_unregister(struct sa1111_driver *driver) ...@@ -1349,9 +1374,70 @@ void sa1111_driver_unregister(struct sa1111_driver *driver)
} }
EXPORT_SYMBOL(sa1111_driver_unregister); EXPORT_SYMBOL(sa1111_driver_unregister);
#ifdef CONFIG_DMABOUNCE
/*
* According to the "Intel StrongARM SA-1111 Microprocessor Companion
* Chip Specification Update" (June 2000), erratum #7, there is a
* significant bug in the SA1111 SDRAM shared memory controller. If
* an access to a region of memory above 1MB relative to the bank base,
* it is important that address bit 10 _NOT_ be asserted. Depending
* on the configuration of the RAM, bit 10 may correspond to one
* of several different (processor-relative) address bits.
*
* This routine only identifies whether or not a given DMA address
* is susceptible to the bug.
*
* This should only get called for sa1111_device types due to the
* way we configure our device dma_masks.
*/
static int sa1111_needs_bounce(struct device *dev, dma_addr_t addr, size_t size)
{
/*
* Section 4.6 of the "Intel StrongARM SA-1111 Development Module
* User's Guide" mentions that jumpers R51 and R52 control the
* target of SA-1111 DMA (either SDRAM bank 0 on Assabet, or
* SDRAM bank 1 on Neponset). The default configuration selects
* Assabet, so any address in bank 1 is necessarily invalid.
*/
return (machine_is_assabet() || machine_is_pfs168()) &&
(addr >= 0xc8000000 || (addr + size) >= 0xc8000000);
}
static int sa1111_notifier_call(struct notifier_block *n, unsigned long action,
void *data)
{
struct sa1111_dev *dev = SA1111_DEV(data);
switch (action) {
case BUS_NOTIFY_ADD_DEVICE:
if (dev->dev.dma_mask && dev->dma_mask < 0xffffffffUL) {
int ret = dmabounce_register_dev(&dev->dev, 1024, 4096,
sa1111_needs_bounce);
if (ret)
dev_err(&dev->dev, "failed to register with dmabounce: %d\n", ret);
}
break;
case BUS_NOTIFY_DEL_DEVICE:
if (dev->dev.dma_mask && dev->dma_mask < 0xffffffffUL)
dmabounce_unregister_dev(&dev->dev);
break;
}
return NOTIFY_OK;
}
static struct notifier_block sa1111_bus_notifier = {
.notifier_call = sa1111_notifier_call,
};
#endif
static int __init sa1111_init(void) static int __init sa1111_init(void)
{ {
int ret = bus_register(&sa1111_bus_type); int ret = bus_register(&sa1111_bus_type);
#ifdef CONFIG_DMABOUNCE
if (ret == 0)
bus_register_notifier(&sa1111_bus_type, &sa1111_bus_notifier);
#endif
if (ret == 0) if (ret == 0)
platform_driver_register(&sa1111_device_driver); platform_driver_register(&sa1111_device_driver);
return ret; return ret;
...@@ -1360,6 +1446,9 @@ static int __init sa1111_init(void) ...@@ -1360,6 +1446,9 @@ static int __init sa1111_init(void)
static void __exit sa1111_exit(void) static void __exit sa1111_exit(void)
{ {
platform_driver_unregister(&sa1111_device_driver); platform_driver_unregister(&sa1111_device_driver);
#ifdef CONFIG_DMABOUNCE
bus_unregister_notifier(&sa1111_bus_type, &sa1111_bus_notifier);
#endif
bus_unregister(&sa1111_bus_type); bus_unregister(&sa1111_bus_type);
} }
......
...@@ -132,33 +132,9 @@ ...@@ -132,33 +132,9 @@
#define SKPCR_DCLKEN (1<<7) #define SKPCR_DCLKEN (1<<7)
#define SKPCR_PWMCLKEN (1<<8) #define SKPCR_PWMCLKEN (1<<8)
/* /* USB Host controller */
* USB Host controller
*/
#define SA1111_USB 0x0400 #define SA1111_USB 0x0400
/*
* Offsets from SA1111_USB_BASE
*/
#define SA1111_USB_STATUS 0x0118
#define SA1111_USB_RESET 0x011c
#define SA1111_USB_IRQTEST 0x0120
#define USB_RESET_FORCEIFRESET (1 << 0)
#define USB_RESET_FORCEHCRESET (1 << 1)
#define USB_RESET_CLKGENRESET (1 << 2)
#define USB_RESET_SIMSCALEDOWN (1 << 3)
#define USB_RESET_USBINTTEST (1 << 4)
#define USB_RESET_SLEEPSTBYEN (1 << 5)
#define USB_RESET_PWRSENSELOW (1 << 6)
#define USB_RESET_PWRCTRLLOW (1 << 7)
#define USB_STATUS_IRQHCIRMTWKUP (1 << 7)
#define USB_STATUS_IRQHCIBUFFACC (1 << 8)
#define USB_STATUS_NIRQHCIM (1 << 9)
#define USB_STATUS_NHCIMFCLR (1 << 10)
#define USB_STATUS_USBPWRSENSE (1 << 11)
/* /*
* Serial Audio Controller * Serial Audio Controller
* *
...@@ -327,22 +303,6 @@ ...@@ -327,22 +303,6 @@
* PC_SSR GPIO Block C Sleep State * PC_SSR GPIO Block C Sleep State
*/ */
#define _PA_DDR _SA1111( 0x1000 )
#define _PA_DRR _SA1111( 0x1004 )
#define _PA_DWR _SA1111( 0x1004 )
#define _PA_SDR _SA1111( 0x1008 )
#define _PA_SSR _SA1111( 0x100c )
#define _PB_DDR _SA1111( 0x1010 )
#define _PB_DRR _SA1111( 0x1014 )
#define _PB_DWR _SA1111( 0x1014 )
#define _PB_SDR _SA1111( 0x1018 )
#define _PB_SSR _SA1111( 0x101c )
#define _PC_DDR _SA1111( 0x1020 )
#define _PC_DRR _SA1111( 0x1024 )
#define _PC_DWR _SA1111( 0x1024 )
#define _PC_SDR _SA1111( 0x1028 )
#define _PC_SSR _SA1111( 0x102c )
#define SA1111_GPIO 0x1000 #define SA1111_GPIO 0x1000
#define SA1111_GPIO_PADDR (0x000) #define SA1111_GPIO_PADDR (0x000)
...@@ -425,106 +385,30 @@ ...@@ -425,106 +385,30 @@
#define SA1111_WAKEPOL0 0x0034 #define SA1111_WAKEPOL0 0x0034
#define SA1111_WAKEPOL1 0x0038 #define SA1111_WAKEPOL1 0x0038
/* /* PS/2 Trackpad and Mouse Interfaces */
* PS/2 Trackpad and Mouse Interfaces
*
* Registers
* PS2CR Control Register
* PS2STAT Status Register
* PS2DATA Transmit/Receive Data register
* PS2CLKDIV Clock Division Register
* PS2PRECNT Clock Precount Register
* PS2TEST1 Test register 1
* PS2TEST2 Test register 2
* PS2TEST3 Test register 3
* PS2TEST4 Test register 4
*/
#define SA1111_KBD 0x0a00 #define SA1111_KBD 0x0a00
#define SA1111_MSE 0x0c00 #define SA1111_MSE 0x0c00
/* /* PCMCIA Interface */
* These are offsets from the above bases. #define SA1111_PCMCIA 0x1600
*/
#define SA1111_PS2CR 0x0000
#define SA1111_PS2STAT 0x0004
#define SA1111_PS2DATA 0x0008
#define SA1111_PS2CLKDIV 0x000c
#define SA1111_PS2PRECNT 0x0010
#define PS2CR_ENA 0x08
#define PS2CR_FKD 0x02
#define PS2CR_FKC 0x01
#define PS2STAT_STP 0x0100
#define PS2STAT_TXE 0x0080
#define PS2STAT_TXB 0x0040
#define PS2STAT_RXF 0x0020
#define PS2STAT_RXB 0x0010
#define PS2STAT_ENA 0x0008
#define PS2STAT_RXP 0x0004
#define PS2STAT_KBD 0x0002
#define PS2STAT_KBC 0x0001
/*
* PCMCIA Interface
*
* Registers
* PCSR Status Register
* PCCR Control Register
* PCSSR Sleep State Register
*/
#define SA1111_PCMCIA 0x1600
/*
* These are offsets from the above base.
*/
#define SA1111_PCCR 0x0000
#define SA1111_PCSSR 0x0004
#define SA1111_PCSR 0x0008
#define PCSR_S0_READY (1<<0)
#define PCSR_S1_READY (1<<1)
#define PCSR_S0_DETECT (1<<2)
#define PCSR_S1_DETECT (1<<3)
#define PCSR_S0_VS1 (1<<4)
#define PCSR_S0_VS2 (1<<5)
#define PCSR_S1_VS1 (1<<6)
#define PCSR_S1_VS2 (1<<7)
#define PCSR_S0_WP (1<<8)
#define PCSR_S1_WP (1<<9)
#define PCSR_S0_BVD1 (1<<10)
#define PCSR_S0_BVD2 (1<<11)
#define PCSR_S1_BVD1 (1<<12)
#define PCSR_S1_BVD2 (1<<13)
#define PCCR_S0_RST (1<<0)
#define PCCR_S1_RST (1<<1)
#define PCCR_S0_FLT (1<<2)
#define PCCR_S1_FLT (1<<3)
#define PCCR_S0_PWAITEN (1<<4)
#define PCCR_S1_PWAITEN (1<<5)
#define PCCR_S0_PSE (1<<6)
#define PCCR_S1_PSE (1<<7)
#define PCSSR_S0_SLEEP (1<<0)
#define PCSSR_S1_SLEEP (1<<1)
extern struct bus_type sa1111_bus_type; extern struct bus_type sa1111_bus_type;
#define SA1111_DEVID_SBI 0 #define SA1111_DEVID_SBI (1 << 0)
#define SA1111_DEVID_SK 1 #define SA1111_DEVID_SK (1 << 1)
#define SA1111_DEVID_USB 2 #define SA1111_DEVID_USB (1 << 2)
#define SA1111_DEVID_SAC 3 #define SA1111_DEVID_SAC (1 << 3)
#define SA1111_DEVID_SSP 4 #define SA1111_DEVID_SSP (1 << 4)
#define SA1111_DEVID_PS2 5 #define SA1111_DEVID_PS2 (3 << 5)
#define SA1111_DEVID_GPIO 6 #define SA1111_DEVID_PS2_KBD (1 << 5)
#define SA1111_DEVID_INT 7 #define SA1111_DEVID_PS2_MSE (1 << 6)
#define SA1111_DEVID_PCMCIA 8 #define SA1111_DEVID_GPIO (1 << 7)
#define SA1111_DEVID_INT (1 << 8)
#define SA1111_DEVID_PCMCIA (1 << 9)
struct sa1111_dev { struct sa1111_dev {
struct device dev; struct device dev;
...@@ -548,6 +432,7 @@ struct sa1111_driver { ...@@ -548,6 +432,7 @@ struct sa1111_driver {
int (*remove)(struct sa1111_dev *); int (*remove)(struct sa1111_dev *);
int (*suspend)(struct sa1111_dev *, pm_message_t); int (*suspend)(struct sa1111_dev *, pm_message_t);
int (*resume)(struct sa1111_dev *); int (*resume)(struct sa1111_dev *);
void (*shutdown)(struct sa1111_dev *);
}; };
#define SA1111_DRV(_d) container_of((_d), struct sa1111_driver, drv) #define SA1111_DRV(_d) container_of((_d), struct sa1111_driver, drv)
...@@ -555,9 +440,10 @@ struct sa1111_driver { ...@@ -555,9 +440,10 @@ struct sa1111_driver {
#define SA1111_DRIVER_NAME(_sadev) ((_sadev)->dev.driver->name) #define SA1111_DRIVER_NAME(_sadev) ((_sadev)->dev.driver->name)
/* /*
* These frob the SKPCR register. * These frob the SKPCR register, and call platform specific
* enable/disable functions.
*/ */
void sa1111_enable_device(struct sa1111_dev *); int sa1111_enable_device(struct sa1111_dev *);
void sa1111_disable_device(struct sa1111_dev *); void sa1111_disable_device(struct sa1111_dev *);
unsigned int sa1111_pll_clock(struct sa1111_dev *); unsigned int sa1111_pll_clock(struct sa1111_dev *);
...@@ -580,6 +466,10 @@ void sa1111_set_sleep_io(struct sa1111_dev *sadev, unsigned int bits, unsigned i ...@@ -580,6 +466,10 @@ void sa1111_set_sleep_io(struct sa1111_dev *sadev, unsigned int bits, unsigned i
struct sa1111_platform_data { struct sa1111_platform_data {
int irq_base; /* base for cascaded on-chip IRQs */ int irq_base; /* base for cascaded on-chip IRQs */
unsigned disable_devs;
void *data;
int (*enable)(void *, unsigned);
void (*disable)(void *, unsigned);
}; };
#endif /* _ASM_ARCH_SA1111 */ #endif /* _ASM_ARCH_SA1111 */
...@@ -23,7 +23,6 @@ obj-$(CONFIG_LEDS) += leds.o ...@@ -23,7 +23,6 @@ obj-$(CONFIG_LEDS) += leds.o
obj-$(CONFIG_OC_ETM) += etm.o obj-$(CONFIG_OC_ETM) += etm.o
obj-$(CONFIG_ISA_DMA_API) += dma.o obj-$(CONFIG_ISA_DMA_API) += dma.o
obj-$(CONFIG_ARCH_ACORN) += ecard.o
obj-$(CONFIG_FIQ) += fiq.o fiqasm.o obj-$(CONFIG_FIQ) += fiq.o fiqasm.o
obj-$(CONFIG_MODULES) += armksyms.o module.o obj-$(CONFIG_MODULES) += armksyms.o module.o
obj-$(CONFIG_ARTHUR) += arthur.o obj-$(CONFIG_ARTHUR) += arthur.o
......
...@@ -30,10 +30,7 @@ ...@@ -30,10 +30,7 @@
#include <asm/mach/time.h> #include <asm/mach/time.h>
#define IRQ_MASK 0xfe000000 /* read */ #include "core.h"
#define IRQ_MSET 0xfe000000 /* write */
#define IRQ_STAT 0xff000000 /* read */
#define IRQ_MCLR 0xff000000 /* write */
static void ebsa110_mask_irq(struct irq_data *d) static void ebsa110_mask_irq(struct irq_data *d)
{ {
...@@ -79,22 +76,22 @@ static struct map_desc ebsa110_io_desc[] __initdata = { ...@@ -79,22 +76,22 @@ static struct map_desc ebsa110_io_desc[] __initdata = {
{ /* IRQ_STAT/IRQ_MCLR */ { /* IRQ_STAT/IRQ_MCLR */
.virtual = IRQ_STAT, .virtual = IRQ_STAT,
.pfn = __phys_to_pfn(TRICK4_PHYS), .pfn = __phys_to_pfn(TRICK4_PHYS),
.length = PGDIR_SIZE, .length = TRICK4_SIZE,
.type = MT_DEVICE .type = MT_DEVICE
}, { /* IRQ_MASK/IRQ_MSET */ }, { /* IRQ_MASK/IRQ_MSET */
.virtual = IRQ_MASK, .virtual = IRQ_MASK,
.pfn = __phys_to_pfn(TRICK3_PHYS), .pfn = __phys_to_pfn(TRICK3_PHYS),
.length = PGDIR_SIZE, .length = TRICK3_SIZE,
.type = MT_DEVICE .type = MT_DEVICE
}, { /* SOFT_BASE */ }, { /* SOFT_BASE */
.virtual = SOFT_BASE, .virtual = SOFT_BASE,
.pfn = __phys_to_pfn(TRICK1_PHYS), .pfn = __phys_to_pfn(TRICK1_PHYS),
.length = PGDIR_SIZE, .length = TRICK1_SIZE,
.type = MT_DEVICE .type = MT_DEVICE
}, { /* PIT_BASE */ }, { /* PIT_BASE */
.virtual = PIT_BASE, .virtual = PIT_BASE,
.pfn = __phys_to_pfn(TRICK0_PHYS), .pfn = __phys_to_pfn(TRICK0_PHYS),
.length = PGDIR_SIZE, .length = TRICK0_SIZE,
.type = MT_DEVICE .type = MT_DEVICE
}, },
......
/*
* Copyright (C) 1996-2000 Russell King.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This file contains the core hardware definitions of the EBSA-110.
*/
#ifndef CORE_H
#define CORE_H
/* Physical addresses/sizes */
#define ISAMEM_PHYS 0xe0000000
#define ISAMEM_SIZE 0x10000000
#define ISAIO_PHYS 0xf0000000
#define ISAIO_SIZE PGDIR_SIZE
#define TRICK0_PHYS 0xf2000000
#define TRICK0_SIZE PGDIR_SIZE
#define TRICK1_PHYS 0xf2400000
#define TRICK1_SIZE PGDIR_SIZE
#define TRICK2_PHYS 0xf2800000
#define TRICK3_PHYS 0xf2c00000
#define TRICK3_SIZE PGDIR_SIZE
#define TRICK4_PHYS 0xf3000000
#define TRICK4_SIZE PGDIR_SIZE
#define TRICK5_PHYS 0xf3400000
#define TRICK6_PHYS 0xf3800000
#define TRICK7_PHYS 0xf3c00000
/* Virtual addresses */
#define PIT_BASE 0xfc000000 /* trick 0 */
#define SOFT_BASE 0xfd000000 /* trick 1 */
#define IRQ_MASK 0xfe000000 /* trick 3 - read */
#define IRQ_MSET 0xfe000000 /* trick 3 - write */
#define IRQ_STAT 0xff000000 /* trick 4 - read */
#define IRQ_MCLR 0xff000000 /* trick 4 - write */
#endif
...@@ -12,48 +12,9 @@ ...@@ -12,48 +12,9 @@
#ifndef __ASM_ARCH_HARDWARE_H #ifndef __ASM_ARCH_HARDWARE_H
#define __ASM_ARCH_HARDWARE_H #define __ASM_ARCH_HARDWARE_H
/*
* The EBSA110 has a weird "ISA IO" region:
*
* Region 0 (addr = 0xf0000000 + io << 2)
* --------------------------------------------------------
* Physical region IO region
* f0000fe0 - f0000ffc 3f8 - 3ff ttyS0
* f0000e60 - f0000e64 398 - 399
* f0000de0 - f0000dfc 378 - 37f lp0
* f0000be0 - f0000bfc 2f8 - 2ff ttyS1
*
* Region 1 (addr = 0xf0000000 + (io & ~1) << 1 + (io & 1))
* --------------------------------------------------------
* Physical region IO region
* f00014f1 a79 pnp write data
* f00007c0 - f00007c1 3e0 - 3e1 pcmcia
* f00004f1 279 pnp address
* f0000440 - f000046c 220 - 236 eth0
* f0000405 203 pnp read data
*/
#define ISAMEM_PHYS 0xe0000000
#define ISAMEM_SIZE 0x10000000
#define ISAIO_PHYS 0xf0000000
#define ISAIO_SIZE PGDIR_SIZE
#define TRICK0_PHYS 0xf2000000
#define TRICK1_PHYS 0xf2400000
#define TRICK2_PHYS 0xf2800000
#define TRICK3_PHYS 0xf2c00000
#define TRICK4_PHYS 0xf3000000
#define TRICK5_PHYS 0xf3400000
#define TRICK6_PHYS 0xf3800000
#define TRICK7_PHYS 0xf3c00000
#define ISAMEM_BASE 0xe0000000 #define ISAMEM_BASE 0xe0000000
#define ISAIO_BASE 0xf0000000 #define ISAIO_BASE 0xf0000000
#define PIT_BASE 0xfc000000
#define SOFT_BASE 0xfd000000
/* /*
* RAM definitions * RAM definitions
*/ */
......
...@@ -177,6 +177,26 @@ void writesl(void __iomem *addr, const void *data, int len) ...@@ -177,6 +177,26 @@ void writesl(void __iomem *addr, const void *data, int len)
} }
EXPORT_SYMBOL(writesl); EXPORT_SYMBOL(writesl);
/*
* The EBSA110 has a weird "ISA IO" region:
*
* Region 0 (addr = 0xf0000000 + io << 2)
* --------------------------------------------------------
* Physical region IO region
* f0000fe0 - f0000ffc 3f8 - 3ff ttyS0
* f0000e60 - f0000e64 398 - 399
* f0000de0 - f0000dfc 378 - 37f lp0
* f0000be0 - f0000bfc 2f8 - 2ff ttyS1
*
* Region 1 (addr = 0xf0000000 + (io & ~1) << 1 + (io & 1))
* --------------------------------------------------------
* Physical region IO region
* f00014f1 a79 pnp write data
* f00007c0 - f00007c1 3e0 - 3e1 pcmcia
* f00004f1 279 pnp address
* f0000440 - f000046c 220 - 236 eth0
* f0000405 203 pnp read data
*/
#define SUPERIO_PORT(p) \ #define SUPERIO_PORT(p) \
(((p) >> 3) == (0x3f8 >> 3) || \ (((p) >> 3) == (0x3f8 >> 3) || \
((p) >> 3) == (0x2f8 >> 3) || \ ((p) >> 3) == (0x2f8 >> 3) || \
......
...@@ -20,6 +20,8 @@ ...@@ -20,6 +20,8 @@
#include <asm/system.h> #include <asm/system.h>
#include <asm/mach-types.h> #include <asm/mach-types.h>
#include "core.h"
static spinlock_t leds_lock; static spinlock_t leds_lock;
static void ebsa110_leds_event(led_event_t ledevt) static void ebsa110_leds_event(led_event_t ledevt)
......
...@@ -223,6 +223,7 @@ static struct resource sa1111_resources[] = { ...@@ -223,6 +223,7 @@ static struct resource sa1111_resources[] = {
static struct sa1111_platform_data sa1111_info = { static struct sa1111_platform_data sa1111_info = {
.irq_base = LUBBOCK_SA1111_IRQ_BASE, .irq_base = LUBBOCK_SA1111_IRQ_BASE,
.disable_devs = SA1111_DEVID_SAC,
}; };
static struct platform_device sa1111_device = { static struct platform_device sa1111_device = {
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
# Object file lists. # Object file lists.
obj-y := dma.o fiq.o irq.o riscpc.o obj-y := dma.o ecard.o fiq.o irq.o riscpc.o time.o
obj-m := obj-m :=
obj-n := obj-n :=
obj- := obj- :=
......
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/mutex.h> #include <linux/mutex.h>
#include <linux/kthread.h> #include <linux/kthread.h>
#include <linux/irq.h>
#include <linux/io.h> #include <linux/io.h>
#include <asm/dma.h> #include <asm/dma.h>
...@@ -54,10 +55,6 @@ ...@@ -54,10 +55,6 @@
#include "ecard.h" #include "ecard.h"
#ifndef CONFIG_ARCH_RPC
#define HAVE_EXPMASK
#endif
struct ecard_request { struct ecard_request {
void (*fn)(struct ecard_request *); void (*fn)(struct ecard_request *);
ecard_t *ec; ecard_t *ec;
...@@ -77,9 +74,6 @@ struct expcard_blacklist { ...@@ -77,9 +74,6 @@ struct expcard_blacklist {
static ecard_t *cards; static ecard_t *cards;
static ecard_t *slot_to_expcard[MAX_ECARDS]; static ecard_t *slot_to_expcard[MAX_ECARDS];
static unsigned int ectcr; static unsigned int ectcr;
#ifdef HAS_EXPMASK
static unsigned int have_expmask;
#endif
/* List of descriptions of cards which don't have an extended /* List of descriptions of cards which don't have an extended
* identification, or chunk directories containing a description. * identification, or chunk directories containing a description.
...@@ -391,22 +385,10 @@ int ecard_readchunk(struct in_chunk_dir *cd, ecard_t *ec, int id, int num) ...@@ -391,22 +385,10 @@ int ecard_readchunk(struct in_chunk_dir *cd, ecard_t *ec, int id, int num)
static void ecard_def_irq_enable(ecard_t *ec, int irqnr) static void ecard_def_irq_enable(ecard_t *ec, int irqnr)
{ {
#ifdef HAS_EXPMASK
if (irqnr < 4 && have_expmask) {
have_expmask |= 1 << irqnr;
__raw_writeb(have_expmask, EXPMASK_ENABLE);
}
#endif
} }
static void ecard_def_irq_disable(ecard_t *ec, int irqnr) static void ecard_def_irq_disable(ecard_t *ec, int irqnr)
{ {
#ifdef HAS_EXPMASK
if (irqnr < 4 && have_expmask) {
have_expmask &= ~(1 << irqnr);
__raw_writeb(have_expmask, EXPMASK_ENABLE);
}
#endif
} }
static int ecard_def_irq_pending(ecard_t *ec) static int ecard_def_irq_pending(ecard_t *ec)
...@@ -446,7 +428,7 @@ static expansioncard_ops_t ecard_default_ops = { ...@@ -446,7 +428,7 @@ static expansioncard_ops_t ecard_default_ops = {
*/ */
static void ecard_irq_unmask(struct irq_data *d) static void ecard_irq_unmask(struct irq_data *d)
{ {
ecard_t *ec = slot_to_ecard(d->irq - 32); ecard_t *ec = irq_data_get_irq_chip_data(d);
if (ec) { if (ec) {
if (!ec->ops) if (!ec->ops)
...@@ -462,7 +444,7 @@ static void ecard_irq_unmask(struct irq_data *d) ...@@ -462,7 +444,7 @@ static void ecard_irq_unmask(struct irq_data *d)
static void ecard_irq_mask(struct irq_data *d) static void ecard_irq_mask(struct irq_data *d)
{ {
ecard_t *ec = slot_to_ecard(d->irq - 32); ecard_t *ec = irq_data_get_irq_chip_data(d);
if (ec) { if (ec) {
if (!ec->ops) if (!ec->ops)
...@@ -579,7 +561,7 @@ ecard_irq_handler(unsigned int irq, struct irq_desc *desc) ...@@ -579,7 +561,7 @@ ecard_irq_handler(unsigned int irq, struct irq_desc *desc)
for (ec = cards; ec; ec = ec->next) { for (ec = cards; ec; ec = ec->next) {
int pending; int pending;
if (!ec->claimed || ec->irq == NO_IRQ || ec->slot_no == 8) if (!ec->claimed || !ec->irq || ec->slot_no == 8)
continue; continue;
if (ec->ops && ec->ops->irqpending) if (ec->ops && ec->ops->irqpending)
...@@ -598,83 +580,6 @@ ecard_irq_handler(unsigned int irq, struct irq_desc *desc) ...@@ -598,83 +580,6 @@ ecard_irq_handler(unsigned int irq, struct irq_desc *desc)
ecard_check_lockup(desc); ecard_check_lockup(desc);
} }
#ifdef HAS_EXPMASK
static unsigned char priority_masks[] =
{
0xf0, 0xf1, 0xf3, 0xf7, 0xff, 0xff, 0xff, 0xff
};
static unsigned char first_set[] =
{
0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00,
0x03, 0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00
};
static void
ecard_irqexp_handler(unsigned int irq, struct irq_desc *desc)
{
const unsigned int statusmask = 15;
unsigned int status;
status = __raw_readb(EXPMASK_STATUS) & statusmask;
if (status) {
unsigned int slot = first_set[status];
ecard_t *ec = slot_to_ecard(slot);
if (ec->claimed) {
/*
* this ugly code is so that we can operate a
* prioritorising system:
*
* Card 0 highest priority
* Card 1
* Card 2
* Card 3 lowest priority
*
* Serial cards should go in 0/1, ethernet/scsi in 2/3
* otherwise you will lose serial data at high speeds!
*/
generic_handle_irq(ec->irq);
} else {
printk(KERN_WARNING "card%d: interrupt from unclaimed "
"card???\n", slot);
have_expmask &= ~(1 << slot);
__raw_writeb(have_expmask, EXPMASK_ENABLE);
}
} else
printk(KERN_WARNING "Wild interrupt from backplane (masks)\n");
}
static int __init ecard_probeirqhw(void)
{
ecard_t *ec;
int found;
__raw_writeb(0x00, EXPMASK_ENABLE);
__raw_writeb(0xff, EXPMASK_STATUS);
found = (__raw_readb(EXPMASK_STATUS) & 15) == 0;
__raw_writeb(0xff, EXPMASK_ENABLE);
if (found) {
printk(KERN_DEBUG "Expansion card interrupt "
"management hardware found\n");
/* for each card present, set a bit to '1' */
have_expmask = 0x80000000;
for (ec = cards; ec; ec = ec->next)
have_expmask |= 1 << ec->slot_no;
__raw_writeb(have_expmask, EXPMASK_ENABLE);
}
return found;
}
#else
#define ecard_irqexp_handler NULL
#define ecard_probeirqhw() (0)
#endif
static void __iomem *__ecard_address(ecard_t *ec, card_type_t type, card_speed_t speed) static void __iomem *__ecard_address(ecard_t *ec, card_type_t type, card_speed_t speed)
{ {
void __iomem *address = NULL; void __iomem *address = NULL;
...@@ -806,8 +711,8 @@ static struct expansion_card *__init ecard_alloc_card(int type, int slot) ...@@ -806,8 +711,8 @@ static struct expansion_card *__init ecard_alloc_card(int type, int slot)
ec->slot_no = slot; ec->slot_no = slot;
ec->easi = type == ECARD_EASI; ec->easi = type == ECARD_EASI;
ec->irq = NO_IRQ; ec->irq = 0;
ec->fiq = NO_IRQ; ec->fiq = 0;
ec->dma = NO_DMA; ec->dma = NO_DMA;
ec->ops = &ecard_default_ops; ec->ops = &ecard_default_ops;
...@@ -978,8 +883,7 @@ EXPORT_SYMBOL(ecardm_iomap); ...@@ -978,8 +883,7 @@ EXPORT_SYMBOL(ecardm_iomap);
* If bit 1 of the first byte of the card is set, then the * If bit 1 of the first byte of the card is set, then the
* card does not exist. * card does not exist.
*/ */
static int __init static int __init ecard_probe(int slot, unsigned irq, card_type_t type)
ecard_probe(int slot, card_type_t type)
{ {
ecard_t **ecp; ecard_t **ecp;
ecard_t *ec; ecard_t *ec;
...@@ -1033,18 +937,18 @@ ecard_probe(int slot, card_type_t type) ...@@ -1033,18 +937,18 @@ ecard_probe(int slot, card_type_t type)
break; break;
} }
ec->irq = irq;
/* /*
* hook the interrupt handlers * hook the interrupt handlers
*/ */
if (slot < 8) { if (slot < 8) {
ec->irq = 32 + slot;
irq_set_chip_and_handler(ec->irq, &ecard_chip, irq_set_chip_and_handler(ec->irq, &ecard_chip,
handle_level_irq); handle_level_irq);
irq_set_chip_data(ec->irq, ec);
set_irq_flags(ec->irq, IRQF_VALID); set_irq_flags(ec->irq, IRQF_VALID);
} }
if (slot == 8)
ec->irq = 11;
#ifdef CONFIG_ARCH_RPC #ifdef CONFIG_ARCH_RPC
/* On RiscPC, only first two slots have DMA capability */ /* On RiscPC, only first two slots have DMA capability */
if (slot < 2) if (slot < 2)
...@@ -1074,28 +978,30 @@ ecard_probe(int slot, card_type_t type) ...@@ -1074,28 +978,30 @@ ecard_probe(int slot, card_type_t type)
static int __init ecard_init(void) static int __init ecard_init(void)
{ {
struct task_struct *task; struct task_struct *task;
int slot, irqhw; int slot, irqbase;
irqbase = irq_alloc_descs(-1, 0, 8, -1);
if (irqbase < 0)
return irqbase;
task = kthread_run(ecard_task, NULL, "kecardd"); task = kthread_run(ecard_task, NULL, "kecardd");
if (IS_ERR(task)) { if (IS_ERR(task)) {
printk(KERN_ERR "Ecard: unable to create kernel thread: %ld\n", printk(KERN_ERR "Ecard: unable to create kernel thread: %ld\n",
PTR_ERR(task)); PTR_ERR(task));
irq_free_descs(irqbase, 8);
return PTR_ERR(task); return PTR_ERR(task);
} }
printk("Probing expansion cards\n"); printk("Probing expansion cards\n");
for (slot = 0; slot < 8; slot ++) { for (slot = 0; slot < 8; slot ++) {
if (ecard_probe(slot, ECARD_EASI) == -ENODEV) if (ecard_probe(slot, irqbase + slot, ECARD_EASI) == -ENODEV)
ecard_probe(slot, ECARD_IOC); ecard_probe(slot, irqbase + slot, ECARD_IOC);
} }
ecard_probe(8, ECARD_IOC); ecard_probe(8, 11, ECARD_IOC);
irqhw = ecard_probeirqhw();
irq_set_chained_handler(IRQ_EXPANSIONCARD, irq_set_chained_handler(IRQ_EXPANSIONCARD, ecard_irq_handler);
irqhw ? ecard_irqexp_handler : ecard_irq_handler);
ecard_proc_init(); ecard_proc_init();
......
File moved
...@@ -42,6 +42,4 @@ ...@@ -42,6 +42,4 @@
*/ */
#define FIQ_START 64 #define FIQ_START 64
#define IRQ_TIMER IRQ_TIMER0
#define NR_IRQS 128 #define NR_IRQS 128
...@@ -98,15 +98,9 @@ static void __init rpc_map_io(void) ...@@ -98,15 +98,9 @@ static void __init rpc_map_io(void)
} }
static struct resource acornfb_resources[] = { static struct resource acornfb_resources[] = {
{ /* VIDC */ /* VIDC */
.start = 0x03400000, DEFINE_RES_MEM(0x03400000, 0x00200000),
.end = 0x035fffff, DEFINE_RES_IRQ(IRQ_VSYNCPULSE),
.flags = IORESOURCE_MEM,
}, {
.start = IRQ_VSYNCPULSE,
.end = IRQ_VSYNCPULSE,
.flags = IORESOURCE_IRQ,
},
}; };
static struct platform_device acornfb_device = { static struct platform_device acornfb_device = {
...@@ -120,11 +114,7 @@ static struct platform_device acornfb_device = { ...@@ -120,11 +114,7 @@ static struct platform_device acornfb_device = {
}; };
static struct resource iomd_resources[] = { static struct resource iomd_resources[] = {
{ DEFINE_RES_MEM(0x03200000, 0x10000),
.start = 0x03200000,
.end = 0x0320ffff,
.flags = IORESOURCE_MEM,
},
}; };
static struct platform_device iomd_device = { static struct platform_device iomd_device = {
...@@ -134,18 +124,25 @@ static struct platform_device iomd_device = { ...@@ -134,18 +124,25 @@ static struct platform_device iomd_device = {
.resource = iomd_resources, .resource = iomd_resources,
}; };
static struct resource iomd_kart_resources[] = {
DEFINE_RES_IRQ(IRQ_KEYBOARDRX),
DEFINE_RES_IRQ(IRQ_KEYBOARDTX),
};
static struct platform_device kbd_device = { static struct platform_device kbd_device = {
.name = "kart", .name = "kart",
.id = -1, .id = -1,
.dev = { .dev = {
.parent = &iomd_device.dev, .parent = &iomd_device.dev,
}, },
.num_resources = ARRAY_SIZE(iomd_kart_resources),
.resource = iomd_kart_resources,
}; };
static struct plat_serial8250_port serial_platform_data[] = { static struct plat_serial8250_port serial_platform_data[] = {
{ {
.mapbase = 0x03010fe0, .mapbase = 0x03010fe0,
.irq = 10, .irq = IRQ_SERIALPORT,
.uartclk = 1843200, .uartclk = 1843200,
.regshift = 2, .regshift = 2,
.iotype = UPIO_MEM, .iotype = UPIO_MEM,
...@@ -167,21 +164,9 @@ static struct pata_platform_info pata_platform_data = { ...@@ -167,21 +164,9 @@ static struct pata_platform_info pata_platform_data = {
}; };
static struct resource pata_resources[] = { static struct resource pata_resources[] = {
[0] = { DEFINE_RES_MEM(0x030107c0, 0x20),
.start = 0x030107c0, DEFINE_RES_MEM(0x03010fd8, 0x04),
.end = 0x030107df, DEFINE_RES_IRQ(IRQ_HARDDISK),
.flags = IORESOURCE_MEM,
},
[1] = {
.start = 0x03010fd8,
.end = 0x03010fdb,
.flags = IORESOURCE_MEM,
},
[2] = {
.start = IRQ_HARDDISK,
.end = IRQ_HARDDISK,
.flags = IORESOURCE_IRQ,
},
}; };
static struct platform_device pata_device = { static struct platform_device pata_device = {
......
...@@ -85,7 +85,7 @@ static struct irqaction ioc_timer_irq = { ...@@ -85,7 +85,7 @@ static struct irqaction ioc_timer_irq = {
static void __init ioc_timer_init(void) static void __init ioc_timer_init(void)
{ {
ioctime_init(); ioctime_init();
setup_irq(IRQ_TIMER, &ioc_timer_irq); setup_irq(IRQ_TIMER0, &ioc_timer_irq);
} }
struct sys_timer ioc_timer = { struct sys_timer ioc_timer = {
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
# #
# Common support # Common support
obj-y := clock.o generic.o irq.o dma.o time.o #nmi-oopser.o obj-y := clock.o generic.o irq.o time.o #nmi-oopser.o
obj-m := obj-m :=
obj-n := obj-n :=
obj- := obj- :=
......
...@@ -15,14 +15,16 @@ ...@@ -15,14 +15,16 @@
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/ioport.h> #include <linux/ioport.h>
#include <linux/serial_core.h> #include <linux/serial_core.h>
#include <linux/mfd/ucb1x00.h>
#include <linux/mtd/mtd.h> #include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h> #include <linux/mtd/partitions.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <video/sa1100fb.h>
#include <mach/hardware.h> #include <mach/hardware.h>
#include <asm/mach-types.h> #include <asm/mach-types.h>
#include <asm/irq.h>
#include <asm/setup.h> #include <asm/setup.h>
#include <asm/page.h> #include <asm/page.h>
#include <asm/pgtable-hwdef.h> #include <asm/pgtable-hwdef.h>
...@@ -36,17 +38,18 @@ ...@@ -36,17 +38,18 @@
#include <asm/mach/serial_sa1100.h> #include <asm/mach/serial_sa1100.h>
#include <mach/assabet.h> #include <mach/assabet.h>
#include <mach/mcp.h> #include <mach/mcp.h>
#include <mach/irqs.h>
#include "generic.h" #include "generic.h"
#define ASSABET_BCR_DB1110 \ #define ASSABET_BCR_DB1110 \
(ASSABET_BCR_SPK_OFF | ASSABET_BCR_QMUTE | \ (ASSABET_BCR_SPK_OFF | \
ASSABET_BCR_LED_GREEN | ASSABET_BCR_LED_RED | \ ASSABET_BCR_LED_GREEN | ASSABET_BCR_LED_RED | \
ASSABET_BCR_RS232EN | ASSABET_BCR_LCD_12RGB | \ ASSABET_BCR_RS232EN | ASSABET_BCR_LCD_12RGB | \
ASSABET_BCR_IRDA_MD0) ASSABET_BCR_IRDA_MD0)
#define ASSABET_BCR_DB1111 \ #define ASSABET_BCR_DB1111 \
(ASSABET_BCR_SPK_OFF | ASSABET_BCR_QMUTE | \ (ASSABET_BCR_SPK_OFF | \
ASSABET_BCR_LED_GREEN | ASSABET_BCR_LED_RED | \ ASSABET_BCR_LED_GREEN | ASSABET_BCR_LED_RED | \
ASSABET_BCR_RS232EN | ASSABET_BCR_LCD_12RGB | \ ASSABET_BCR_RS232EN | ASSABET_BCR_LCD_12RGB | \
ASSABET_BCR_CF_BUS_OFF | ASSABET_BCR_STEREO_LB | \ ASSABET_BCR_CF_BUS_OFF | ASSABET_BCR_STEREO_LB | \
...@@ -69,31 +72,10 @@ void ASSABET_BCR_frob(unsigned int mask, unsigned int val) ...@@ -69,31 +72,10 @@ void ASSABET_BCR_frob(unsigned int mask, unsigned int val)
EXPORT_SYMBOL(ASSABET_BCR_frob); EXPORT_SYMBOL(ASSABET_BCR_frob);
static void assabet_backlight_power(int on) static void assabet_ucb1x00_reset(enum ucb1x00_reset state)
{
#ifndef ASSABET_PAL_VIDEO
if (on)
ASSABET_BCR_set(ASSABET_BCR_LIGHT_ON);
else
#endif
ASSABET_BCR_clear(ASSABET_BCR_LIGHT_ON);
}
/*
* Turn on/off the backlight. When turning the backlight on,
* we wait 500us after turning it on so we don't cause the
* supplies to droop when we enable the LCD controller (and
* cause a hard reset.)
*/
static void assabet_lcd_power(int on)
{ {
#ifndef ASSABET_PAL_VIDEO if (state == UCB_RST_PROBE)
if (on) { ASSABET_BCR_set(ASSABET_BCR_CODEC_RST);
ASSABET_BCR_set(ASSABET_BCR_LCD_ON);
udelay(500);
} else
#endif
ASSABET_BCR_clear(ASSABET_BCR_LCD_ON);
} }
...@@ -152,15 +134,8 @@ static struct flash_platform_data assabet_flash_data = { ...@@ -152,15 +134,8 @@ static struct flash_platform_data assabet_flash_data = {
}; };
static struct resource assabet_flash_resources[] = { static struct resource assabet_flash_resources[] = {
{ DEFINE_RES_MEM(SA1100_CS0_PHYS, SZ_32M),
.start = SA1100_CS0_PHYS, DEFINE_RES_MEM(SA1100_CS1_PHYS, SZ_32M),
.end = SA1100_CS0_PHYS + SZ_32M - 1,
.flags = IORESOURCE_MEM,
}, {
.start = SA1100_CS1_PHYS,
.end = SA1100_CS1_PHYS + SZ_32M - 1,
.flags = IORESOURCE_MEM,
}
}; };
...@@ -199,18 +174,126 @@ static struct irda_platform_data assabet_irda_data = { ...@@ -199,18 +174,126 @@ static struct irda_platform_data assabet_irda_data = {
.set_speed = assabet_irda_set_speed, .set_speed = assabet_irda_set_speed,
}; };
static struct ucb1x00_plat_data assabet_ucb1x00_data = {
.reset = assabet_ucb1x00_reset,
.gpio_base = -1,
};
static struct mcp_plat_data assabet_mcp_data = { static struct mcp_plat_data assabet_mcp_data = {
.mccr0 = MCCR0_ADM, .mccr0 = MCCR0_ADM,
.sclk_rate = 11981000, .sclk_rate = 11981000,
.codec_pdata = &assabet_ucb1x00_data,
};
static void assabet_lcd_set_visual(u32 visual)
{
u_int is_true_color = visual == FB_VISUAL_TRUECOLOR;
if (machine_is_assabet()) {
#if 1 // phase 4 or newer Assabet's
if (is_true_color)
ASSABET_BCR_set(ASSABET_BCR_LCD_12RGB);
else
ASSABET_BCR_clear(ASSABET_BCR_LCD_12RGB);
#else
// older Assabet's
if (is_true_color)
ASSABET_BCR_clear(ASSABET_BCR_LCD_12RGB);
else
ASSABET_BCR_set(ASSABET_BCR_LCD_12RGB);
#endif
}
}
#ifndef ASSABET_PAL_VIDEO
static void assabet_lcd_backlight_power(int on)
{
if (on)
ASSABET_BCR_set(ASSABET_BCR_LIGHT_ON);
else
ASSABET_BCR_clear(ASSABET_BCR_LIGHT_ON);
}
/*
* Turn on/off the backlight. When turning the backlight on, we wait
* 500us after turning it on so we don't cause the supplies to droop
* when we enable the LCD controller (and cause a hard reset.)
*/
static void assabet_lcd_power(int on)
{
if (on) {
ASSABET_BCR_set(ASSABET_BCR_LCD_ON);
udelay(500);
} else
ASSABET_BCR_clear(ASSABET_BCR_LCD_ON);
}
/*
* The assabet uses a sharp LQ039Q2DS54 LCD module. It is actually
* takes an RGB666 signal, but we provide it with an RGB565 signal
* instead (def_rgb_16).
*/
static struct sa1100fb_mach_info lq039q2ds54_info = {
.pixclock = 171521, .bpp = 16,
.xres = 320, .yres = 240,
.hsync_len = 5, .vsync_len = 1,
.left_margin = 61, .upper_margin = 3,
.right_margin = 9, .lower_margin = 0,
.sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
.lccr0 = LCCR0_Color | LCCR0_Sngl | LCCR0_Act,
.lccr3 = LCCR3_OutEnH | LCCR3_PixRsEdg | LCCR3_ACBsDiv(2),
.backlight_power = assabet_lcd_backlight_power,
.lcd_power = assabet_lcd_power,
.set_visual = assabet_lcd_set_visual,
};
#else
static void assabet_pal_backlight_power(int on)
{
ASSABET_BCR_clear(ASSABET_BCR_LIGHT_ON);
}
static void assabet_pal_power(int on)
{
ASSABET_BCR_clear(ASSABET_BCR_LCD_ON);
}
static struct sa1100fb_mach_info pal_info = {
.pixclock = 67797, .bpp = 16,
.xres = 640, .yres = 512,
.hsync_len = 64, .vsync_len = 6,
.left_margin = 125, .upper_margin = 70,
.right_margin = 115, .lower_margin = 36,
.lccr0 = LCCR0_Color | LCCR0_Sngl | LCCR0_Act,
.lccr3 = LCCR3_OutEnH | LCCR3_PixRsEdg | LCCR3_ACBsDiv(512),
.backlight_power = assabet_pal_backlight_power,
.lcd_power = assabet_pal_power,
.set_visual = assabet_lcd_set_visual,
}; };
#endif
#ifdef CONFIG_ASSABET_NEPONSET
static struct resource neponset_resources[] = {
DEFINE_RES_MEM(0x10000000, 0x08000000),
DEFINE_RES_MEM(0x18000000, 0x04000000),
DEFINE_RES_MEM(0x40000000, SZ_8K),
DEFINE_RES_IRQ(IRQ_GPIO25),
};
#endif
static void __init assabet_init(void) static void __init assabet_init(void)
{ {
/* /*
* Ensure that the power supply is in "high power" mode. * Ensure that the power supply is in "high power" mode.
*/ */
GPDR |= GPIO_GPIO16;
GPSR = GPIO_GPIO16; GPSR = GPIO_GPIO16;
GPDR |= GPIO_GPIO16;
/* /*
* Ensure that these pins are set as outputs and are driving * Ensure that these pins are set as outputs and are driving
...@@ -218,8 +301,16 @@ static void __init assabet_init(void) ...@@ -218,8 +301,16 @@ static void __init assabet_init(void)
* the WS latch in the CPLD, and we don't float causing * the WS latch in the CPLD, and we don't float causing
* excessive power drain. --rmk * excessive power drain. --rmk
*/ */
GPDR |= GPIO_SSP_TXD | GPIO_SSP_SCLK | GPIO_SSP_SFRM;
GPCR = GPIO_SSP_TXD | GPIO_SSP_SCLK | GPIO_SSP_SFRM; GPCR = GPIO_SSP_TXD | GPIO_SSP_SCLK | GPIO_SSP_SFRM;
GPDR |= GPIO_SSP_TXD | GPIO_SSP_SCLK | GPIO_SSP_SFRM;
/*
* Also set GPIO27 as an output; this is used to clock UART3
* via the FPGA and as otherwise has no pullups or pulldowns,
* so stop it floating.
*/
GPCR = GPIO_GPIO27;
GPDR |= GPIO_GPIO27;
/* /*
* Set up registers for sleep mode. * Set up registers for sleep mode.
...@@ -231,8 +322,7 @@ static void __init assabet_init(void) ...@@ -231,8 +322,7 @@ static void __init assabet_init(void)
PPDR |= PPC_TXD3 | PPC_TXD1; PPDR |= PPC_TXD3 | PPC_TXD1;
PPSR |= PPC_TXD3 | PPC_TXD1; PPSR |= PPC_TXD3 | PPC_TXD1;
sa1100fb_lcd_power = assabet_lcd_power; sa11x0_ppc_configure_mcp();
sa1100fb_backlight_power = assabet_backlight_power;
if (machine_has_neponset()) { if (machine_has_neponset()) {
/* /*
...@@ -246,9 +336,17 @@ static void __init assabet_init(void) ...@@ -246,9 +336,17 @@ static void __init assabet_init(void)
#ifndef CONFIG_ASSABET_NEPONSET #ifndef CONFIG_ASSABET_NEPONSET
printk( "Warning: Neponset detected but full support " printk( "Warning: Neponset detected but full support "
"hasn't been configured in the kernel\n" ); "hasn't been configured in the kernel\n" );
#else
platform_device_register_simple("neponset", 0,
neponset_resources, ARRAY_SIZE(neponset_resources));
#endif #endif
} }
#ifndef ASSABET_PAL_VIDEO
sa11x0_register_lcd(&lq039q2ds54_info);
#else
sa11x0_register_lcd(&pal_video);
#endif
sa11x0_register_mtd(&assabet_flash_data, assabet_flash_resources, sa11x0_register_mtd(&assabet_flash_data, assabet_flash_resources,
ARRAY_SIZE(assabet_flash_resources)); ARRAY_SIZE(assabet_flash_resources));
sa11x0_register_irda(&assabet_irda_data); sa11x0_register_irda(&assabet_irda_data);
...@@ -412,21 +510,8 @@ static void __init assabet_map_io(void) ...@@ -412,21 +510,8 @@ static void __init assabet_map_io(void)
*/ */
Ser1SDCR0 |= SDCR0_SUS; Ser1SDCR0 |= SDCR0_SUS;
if (machine_has_neponset()) { if (!machine_has_neponset())
#ifdef CONFIG_ASSABET_NEPONSET
extern void neponset_map_io(void);
/*
* We map Neponset registers even if it isn't present since
* many drivers will try to probe their stuff (and fail).
* This is still more friendly than a kernel paging request
* crash.
*/
neponset_map_io();
#endif
} else {
sa1100_register_uart_fns(&assabet_port_fns); sa1100_register_uart_fns(&assabet_port_fns);
}
/* /*
* When Neponset is attached, the first UART should be * When Neponset is attached, the first UART should be
...@@ -449,6 +534,7 @@ MACHINE_START(ASSABET, "Intel-Assabet") ...@@ -449,6 +534,7 @@ MACHINE_START(ASSABET, "Intel-Assabet")
.atag_offset = 0x100, .atag_offset = 0x100,
.fixup = fixup_assabet, .fixup = fixup_assabet,
.map_io = assabet_map_io, .map_io = assabet_map_io,
.nr_irqs = SA1100_NR_IRQS,
.init_irq = sa1100_init_irq, .init_irq = sa1100_init_irq,
.timer = &sa1100_timer, .timer = &sa1100_timer,
.init_machine = assabet_init, .init_machine = assabet_init,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment