From 09150b2e572d74e3787cc4e283b3cc584a0be770 Mon Sep 17 00:00:00 2001 From: Ben Dooks Date: Wed, 11 Jul 2007 10:14:53 +0100 Subject: [PATCH] --- yaml --- r: 59270 b: refs/heads/master c: eac1d8dab03bde6d20679c961a6409c1b786c201 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/arch/arm/common/sharpsl_pm.c | 2 + trunk/arch/arm/mach-pxa/clock.c | 15 +-- trunk/arch/arm/mach-pxa/corgi.c | 7 +- trunk/arch/arm/mach-pxa/devices.h | 11 -- trunk/arch/arm/mach-pxa/dma.c | 44 +++----- trunk/arch/arm/mach-pxa/generic.c | 93 ++++++++++++---- trunk/arch/arm/mach-pxa/generic.h | 6 +- trunk/arch/arm/mach-pxa/idp.c | 3 +- trunk/arch/arm/mach-pxa/irq.c | 106 ++++++++++--------- trunk/arch/arm/mach-pxa/lpd270.c | 3 +- trunk/arch/arm/mach-pxa/lubbock.c | 3 +- trunk/arch/arm/mach-pxa/mainstone.c | 3 +- trunk/arch/arm/mach-pxa/pm.c | 47 ++++++++ trunk/arch/arm/mach-pxa/poodle.c | 3 +- trunk/arch/arm/mach-pxa/pxa25x.c | 62 +++-------- trunk/arch/arm/mach-pxa/pxa27x.c | 78 +++----------- trunk/arch/arm/mach-pxa/spitz.c | 7 +- trunk/arch/arm/mach-pxa/time.c | 9 ++ trunk/arch/arm/mach-pxa/tosa.c | 4 +- trunk/arch/arm/mach-pxa/trizeps4.c | 3 +- trunk/arch/arm/mach-s3c2440/mach-anubis.c | 35 ++++++ trunk/drivers/mmc/host/pxamci.h | 22 ++++ trunk/include/asm-arm/arch-pxa/dma.h | 22 +++- trunk/include/asm-arm/arch-pxa/entry-macro.S | 30 ++---- trunk/include/asm-arm/arch-pxa/hardware.h | 36 ------- trunk/include/asm-arm/arch-pxa/irqs.h | 26 +++-- trunk/include/asm-arm/arch-pxa/pm.h | 1 + trunk/include/asm-arm/arch-pxa/pxa-regs.h | 22 +++- 29 files changed, 373 insertions(+), 332 deletions(-) delete mode 100644 trunk/arch/arm/mach-pxa/devices.h diff --git a/[refs] b/[refs] index 3f50f380d5d5..3051d4859526 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 46c41e62a1feb4ab2e941f33f06bbf8feab2d2cf +refs/heads/master: eac1d8dab03bde6d20679c961a6409c1b786c201 diff --git a/trunk/arch/arm/common/sharpsl_pm.c b/trunk/arch/arm/common/sharpsl_pm.c index 111a7fa5debe..3bf3a927ae22 100644 --- a/trunk/arch/arm/common/sharpsl_pm.c +++ b/trunk/arch/arm/common/sharpsl_pm.c @@ -766,7 +766,9 @@ static void sharpsl_apm_get_power_status(struct apm_power_info *info) } static struct pm_ops sharpsl_pm_ops = { + .prepare = pxa_pm_prepare, .enter = corgi_pxa_pm_enter, + .finish = pxa_pm_finish, .valid = pm_valid_only_mem, }; diff --git a/trunk/arch/arm/mach-pxa/clock.c b/trunk/arch/arm/mach-pxa/clock.c index 34a31caa6f9d..8f7c90a0593b 100644 --- a/trunk/arch/arm/mach-pxa/clock.c +++ b/trunk/arch/arm/mach-pxa/clock.c @@ -12,6 +12,7 @@ #include #include +#include struct clk { struct list_head node; @@ -24,21 +25,21 @@ struct clk { }; static LIST_HEAD(clocks); -static DEFINE_MUTEX(clocks_mutex); +static DECLARE_MUTEX(clocks_sem); static DEFINE_SPINLOCK(clocks_lock); struct clk *clk_get(struct device *dev, const char *id) { struct clk *p, *clk = ERR_PTR(-ENOENT); - mutex_lock(&clocks_mutex); + down(&clocks_sem); list_for_each_entry(p, &clocks, node) { if (strcmp(id, p->name) == 0 && try_module_get(p->owner)) { clk = p; break; } } - mutex_unlock(&clocks_mutex); + up(&clocks_sem); return clk; } @@ -100,18 +101,18 @@ static struct clk clk_gpio27 = { int clk_register(struct clk *clk) { - mutex_lock(&clocks_mutex); + down(&clocks_sem); list_add(&clk->node, &clocks); - mutex_unlock(&clocks_mutex); + up(&clocks_sem); return 0; } EXPORT_SYMBOL(clk_register); void clk_unregister(struct clk *clk) { - mutex_lock(&clocks_mutex); + down(&clocks_sem); list_del(&clk->node); - mutex_unlock(&clocks_mutex); + up(&clocks_sem); } EXPORT_SYMBOL(clk_unregister); diff --git a/trunk/arch/arm/mach-pxa/corgi.c b/trunk/arch/arm/mach-pxa/corgi.c index aab27297b3c6..a1a900d16665 100644 --- a/trunk/arch/arm/mach-pxa/corgi.c +++ b/trunk/arch/arm/mach-pxa/corgi.c @@ -44,7 +44,6 @@ #include #include "generic.h" -#include "devices.h" #include "sharpsl.h" @@ -369,7 +368,7 @@ MACHINE_START(CORGI, "SHARP Corgi") .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, .fixup = fixup_corgi, .map_io = pxa_map_io, - .init_irq = pxa25x_init_irq, + .init_irq = pxa_init_irq, .init_machine = corgi_init, .timer = &pxa_timer, MACHINE_END @@ -381,7 +380,7 @@ MACHINE_START(SHEPHERD, "SHARP Shepherd") .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, .fixup = fixup_corgi, .map_io = pxa_map_io, - .init_irq = pxa25x_init_irq, + .init_irq = pxa_init_irq, .init_machine = corgi_init, .timer = &pxa_timer, MACHINE_END @@ -393,7 +392,7 @@ MACHINE_START(HUSKY, "SHARP Husky") .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, .fixup = fixup_corgi, .map_io = pxa_map_io, - .init_irq = pxa25x_init_irq, + .init_irq = pxa_init_irq, .init_machine = corgi_init, .timer = &pxa_timer, MACHINE_END diff --git a/trunk/arch/arm/mach-pxa/devices.h b/trunk/arch/arm/mach-pxa/devices.h deleted file mode 100644 index 9a6faff8e5a7..000000000000 --- a/trunk/arch/arm/mach-pxa/devices.h +++ /dev/null @@ -1,11 +0,0 @@ -extern struct platform_device pxamci_device; -extern struct platform_device pxaudc_device; -extern struct platform_device pxafb_device; -extern struct platform_device ffuart_device; -extern struct platform_device btuart_device; -extern struct platform_device stuart_device; -extern struct platform_device hwuart_device; -extern struct platform_device pxai2c_device; -extern struct platform_device pxai2s_device; -extern struct platform_device pxaficp_device; -extern struct platform_device pxartc_device; diff --git a/trunk/arch/arm/mach-pxa/dma.c b/trunk/arch/arm/mach-pxa/dma.c index 93c4f31f127f..4440babe7b97 100644 --- a/trunk/arch/arm/mach-pxa/dma.c +++ b/trunk/arch/arm/mach-pxa/dma.c @@ -25,15 +25,12 @@ #include -struct dma_channel { +static struct dma_channel { char *name; - pxa_dma_prio prio; void (*irq_handler)(int, void *); void *data; -}; +} dma_channels[PXA_DMA_CHANNELS]; -static struct dma_channel *dma_channels; -static int num_dma_channels; int pxa_request_dma (char *name, pxa_dma_prio prio, void (*irq_handler)(int, void *), @@ -50,9 +47,8 @@ int pxa_request_dma (char *name, pxa_dma_prio prio, do { /* try grabbing a DMA channel with the requested priority */ - for (i = 0; i < num_dma_channels; i++) { - if ((dma_channels[i].prio == prio) && - !dma_channels[i].name) { + pxa_for_each_dma_prio (i, prio) { + if (!dma_channels[i].name) { found = 1; break; } @@ -95,7 +91,7 @@ static irqreturn_t dma_irq_handler(int irq, void *dev_id) { int i, dint = DINT; - for (i = 0; i < num_dma_channels; i++) { + for (i = 0; i < PXA_DMA_CHANNELS; i++) { if (dint & (1 << i)) { struct dma_channel *channel = &dma_channels[i]; if (channel->name && channel->irq_handler) { @@ -113,32 +109,18 @@ static irqreturn_t dma_irq_handler(int irq, void *dev_id) return IRQ_HANDLED; } -int __init pxa_init_dma(int num_ch) +static int __init pxa_dma_init (void) { - int i, ret; + int ret; - dma_channels = kzalloc(sizeof(struct dma_channel) * num_ch, GFP_KERNEL); - if (dma_channels == NULL) - return -ENOMEM; - - ret = request_irq(IRQ_DMA, dma_irq_handler, IRQF_DISABLED, "DMA", NULL); - if (ret) { + ret = request_irq (IRQ_DMA, dma_irq_handler, 0, "DMA", NULL); + if (ret) printk (KERN_CRIT "Wow! Can't register IRQ for DMA\n"); - kfree(dma_channels); - return ret; - } - - /* dma channel priorities on pxa2xx processors: - * ch 0 - 3, 16 - 19 <--> (0) DMA_PRIO_HIGH - * ch 4 - 7, 20 - 23 <--> (1) DMA_PRIO_MEDIUM - * ch 8 - 15, 24 - 31 <--> (2) DMA_PRIO_LOW - */ - for (i = 0; i < num_ch; i++) - dma_channels[i].prio = min((i & 0xf) >> 2, DMA_PRIO_LOW); - - num_dma_channels = num_ch; - return 0; + return ret; } +arch_initcall(pxa_dma_init); + EXPORT_SYMBOL(pxa_request_dma); EXPORT_SYMBOL(pxa_free_dma); + diff --git a/trunk/arch/arm/mach-pxa/generic.c b/trunk/arch/arm/mach-pxa/generic.c index 296539b6359c..64b08b744f9f 100644 --- a/trunk/arch/arm/mach-pxa/generic.c +++ b/trunk/arch/arm/mach-pxa/generic.c @@ -43,7 +43,6 @@ #include #include -#include "devices.h" #include "generic.h" /* @@ -243,7 +242,7 @@ static struct resource pxamci_resources[] = { static u64 pxamci_dmamask = 0xffffffffUL; -struct platform_device pxamci_device = { +static struct platform_device pxamci_device = { .name = "pxa2xx-mci", .id = -1, .dev = { @@ -282,7 +281,7 @@ static struct resource pxa2xx_udc_resources[] = { static u64 udc_dma_mask = ~(u32)0; -struct platform_device pxaudc_device = { +static struct platform_device udc_device = { .name = "pxa2xx-udc", .id = -1, .resource = pxa2xx_udc_resources, @@ -308,7 +307,7 @@ static struct resource pxafb_resources[] = { static u64 fb_dma_mask = ~(u64)0; -struct platform_device pxafb_device = { +static struct platform_device pxafb_device = { .name = "pxa2xx-fb", .id = -1, .dev = { @@ -329,24 +328,24 @@ void __init set_pxa_fb_parent(struct device *parent_dev) pxafb_device.dev.parent = parent_dev; } -struct platform_device ffuart_device = { +static struct platform_device ffuart_device = { .name = "pxa2xx-uart", .id = 0, }; -struct platform_device btuart_device = { +static struct platform_device btuart_device = { .name = "pxa2xx-uart", .id = 1, }; -struct platform_device stuart_device = { +static struct platform_device stuart_device = { .name = "pxa2xx-uart", .id = 2, }; -struct platform_device hwuart_device = { +static struct platform_device hwuart_device = { .name = "pxa2xx-uart", .id = 3, }; -static struct resource pxai2c_resources[] = { +static struct resource i2c_resources[] = { { .start = 0x40301680, .end = 0x403016a3, @@ -358,19 +357,40 @@ static struct resource pxai2c_resources[] = { }, }; -struct platform_device pxai2c_device = { +static struct platform_device i2c_device = { .name = "pxa2xx-i2c", .id = 0, - .resource = pxai2c_resources, - .num_resources = ARRAY_SIZE(pxai2c_resources), + .resource = i2c_resources, + .num_resources = ARRAY_SIZE(i2c_resources), }; +#ifdef CONFIG_PXA27x +static struct resource i2c_power_resources[] = { + { + .start = 0x40f00180, + .end = 0x40f001a3, + .flags = IORESOURCE_MEM, + }, { + .start = IRQ_PWRI2C, + .end = IRQ_PWRI2C, + .flags = IORESOURCE_IRQ, + }, +}; + +static struct platform_device i2c_power_device = { + .name = "pxa2xx-i2c", + .id = 1, + .resource = i2c_power_resources, + .num_resources = ARRAY_SIZE(i2c_resources), +}; +#endif + void __init pxa_set_i2c_info(struct i2c_pxa_platform_data *info) { - pxai2c_device.dev.platform_data = info; + i2c_device.dev.platform_data = info; } -static struct resource pxai2s_resources[] = { +static struct resource i2s_resources[] = { { .start = 0x40400000, .end = 0x40400083, @@ -382,16 +402,16 @@ static struct resource pxai2s_resources[] = { }, }; -struct platform_device pxai2s_device = { +static struct platform_device i2s_device = { .name = "pxa2xx-i2s", .id = -1, - .resource = pxai2s_resources, - .num_resources = ARRAY_SIZE(pxai2s_resources), + .resource = i2s_resources, + .num_resources = ARRAY_SIZE(i2s_resources), }; static u64 pxaficp_dmamask = ~(u32)0; -struct platform_device pxaficp_device = { +static struct platform_device pxaficp_device = { .name = "pxa2xx-ir", .id = -1, .dev = { @@ -405,7 +425,42 @@ void __init pxa_set_ficp_info(struct pxaficp_platform_data *info) pxaficp_device.dev.platform_data = info; } -struct platform_device pxartc_device = { +static struct platform_device pxartc_device = { .name = "sa1100-rtc", .id = -1, }; + +static struct platform_device *devices[] __initdata = { + &pxamci_device, + &udc_device, + &pxafb_device, + &ffuart_device, + &btuart_device, + &stuart_device, + &pxaficp_device, + &i2c_device, +#ifdef CONFIG_PXA27x + &i2c_power_device, +#endif + &i2s_device, + &pxartc_device, +}; + +static int __init pxa_init(void) +{ + int cpuid, ret; + + ret = platform_add_devices(devices, ARRAY_SIZE(devices)); + if (ret) + return ret; + + /* Only add HWUART for PXA255/26x; PXA210/250/27x do not have it. */ + cpuid = read_cpuid(CPUID_ID); + if (((cpuid >> 4) & 0xfff) == 0x2d0 || + ((cpuid >> 4) & 0xfff) == 0x290) + ret = platform_device_register(&hwuart_device); + + return ret; +} + +subsys_initcall(pxa_init); diff --git a/trunk/arch/arm/mach-pxa/generic.h b/trunk/arch/arm/mach-pxa/generic.h index 91ab2ad8b34b..e54a8dd63c17 100644 --- a/trunk/arch/arm/mach-pxa/generic.h +++ b/trunk/arch/arm/mach-pxa/generic.h @@ -12,12 +12,8 @@ struct sys_timer; extern struct sys_timer pxa_timer; -extern void __init pxa_init_irq_low(void); -extern void __init pxa_init_irq_high(void); -extern void __init pxa_init_irq_gpio(int gpio_nr); -extern void __init pxa25x_init_irq(void); -extern void __init pxa27x_init_irq(void); extern void __init pxa_map_io(void); +extern void __init pxa_init_irq(void); extern unsigned int get_clk_frequency_khz(int info); diff --git a/trunk/arch/arm/mach-pxa/idp.c b/trunk/arch/arm/mach-pxa/idp.c index 465108da2851..64df44043a65 100644 --- a/trunk/arch/arm/mach-pxa/idp.c +++ b/trunk/arch/arm/mach-pxa/idp.c @@ -38,7 +38,6 @@ #include #include "generic.h" -#include "devices.h" /* TODO: * - add pxa2xx_audio_ops_t device structure @@ -153,7 +152,7 @@ static void __init idp_init(void) static void __init idp_init_irq(void) { - pxa25x_init_irq(); + pxa_init_irq(); set_irq_type(TOUCH_PANEL_IRQ, TOUCH_PANEL_IRQ_EDGE); } diff --git a/trunk/arch/arm/mach-pxa/irq.c b/trunk/arch/arm/mach-pxa/irq.c index 4b867b0789d5..4619d5fe606c 100644 --- a/trunk/arch/arm/mach-pxa/irq.c +++ b/trunk/arch/arm/mach-pxa/irq.c @@ -30,12 +30,12 @@ static void pxa_mask_low_irq(unsigned int irq) { - ICMR &= ~(1 << irq); + ICMR &= ~(1 << (irq + PXA_IRQ_SKIP)); } static void pxa_unmask_low_irq(unsigned int irq) { - ICMR |= (1 << irq); + ICMR |= (1 << (irq + PXA_IRQ_SKIP)); } static int pxa_set_wake(unsigned int irq, unsigned int on) @@ -67,27 +67,7 @@ static struct irq_chip pxa_internal_chip_low = { .set_wake = pxa_set_wake, }; -void __init pxa_init_irq_low(void) -{ - int irq; - - /* disable all IRQs */ - ICMR = 0; - - /* all IRQs are IRQ, not FIQ */ - ICLR = 0; - - /* only unmasked interrupts kick us out of idle */ - ICCR = 1; - - for (irq = PXA_IRQ(0); irq <= PXA_IRQ(31); irq++) { - set_irq_chip(irq, &pxa_internal_chip_low); - set_irq_handler(irq, handle_level_irq); - set_irq_flags(irq, IRQF_VALID); - } -} - -#ifdef CONFIG_PXA27x +#if PXA_INTERNAL_IRQS > 32 /* * This is for the second set of internal IRQs as found on the PXA27x. @@ -95,12 +75,12 @@ void __init pxa_init_irq_low(void) static void pxa_mask_high_irq(unsigned int irq) { - ICMR2 &= ~(1 << (irq - 32)); + ICMR2 &= ~(1 << (irq - 32 + PXA_IRQ_SKIP)); } static void pxa_unmask_high_irq(unsigned int irq) { - ICMR2 |= (1 << (irq - 32)); + ICMR2 |= (1 << (irq - 32 + PXA_IRQ_SKIP)); } static struct irq_chip pxa_internal_chip_high = { @@ -110,19 +90,6 @@ static struct irq_chip pxa_internal_chip_high = { .unmask = pxa_unmask_high_irq, }; -void __init pxa_init_irq_high(void) -{ - int irq; - - ICMR2 = 0; - ICLR2 = 0; - - for (irq = PXA_IRQ(32); irq < PXA_IRQ(64); irq++) { - set_irq_chip(irq, &pxa_internal_chip_high); - set_irq_handler(irq, handle_level_irq); - set_irq_flags(irq, IRQF_VALID); - } -} #endif /* Note that if an input/irq line ever gets changed to an output during @@ -250,7 +217,7 @@ static void pxa_gpio_demux_handler(unsigned int irq, struct irq_desc *desc) do { loop = 0; - mask = GEDR0 & GPIO_IRQ_mask[0] & ~3; + mask = GEDR0 & ~3; if (mask) { GEDR0 = mask; irq = IRQ_GPIO(2); @@ -266,7 +233,7 @@ static void pxa_gpio_demux_handler(unsigned int irq, struct irq_desc *desc) loop = 1; } - mask = GEDR1 & GPIO_IRQ_mask[1]; + mask = GEDR1; if (mask) { GEDR1 = mask; irq = IRQ_GPIO(32); @@ -281,7 +248,7 @@ static void pxa_gpio_demux_handler(unsigned int irq, struct irq_desc *desc) loop = 1; } - mask = GEDR2 & GPIO_IRQ_mask[2]; + mask = GEDR2; if (mask) { GEDR2 = mask; irq = IRQ_GPIO(64); @@ -296,7 +263,8 @@ static void pxa_gpio_demux_handler(unsigned int irq, struct irq_desc *desc) loop = 1; } - mask = GEDR3 & GPIO_IRQ_mask[3]; +#if PXA_LAST_GPIO >= 96 + mask = GEDR3; if (mask) { GEDR3 = mask; irq = IRQ_GPIO(96); @@ -310,6 +278,7 @@ static void pxa_gpio_demux_handler(unsigned int irq, struct irq_desc *desc) } while (mask); loop = 1; } +#endif } while (loop); } @@ -345,27 +314,64 @@ static struct irq_chip pxa_muxed_gpio_chip = { .set_wake = pxa_set_gpio_wake, }; -void __init pxa_init_irq_gpio(int gpio_nr) + +void __init pxa_init_irq(void) { - int irq, i; + int irq; + + /* disable all IRQs */ + ICMR = 0; + + /* all IRQs are IRQ, not FIQ */ + ICLR = 0; /* clear all GPIO edge detects */ - for (i = 0; i < gpio_nr; i += 32) { - GFER(i) = 0; - GRER(i) = 0; - GEDR(i) = GEDR(i); - } + GFER0 = 0; + GFER1 = 0; + GFER2 = 0; + GRER0 = 0; + GRER1 = 0; + GRER2 = 0; + GEDR0 = GEDR0; + GEDR1 = GEDR1; + GEDR2 = GEDR2; + +#ifdef CONFIG_PXA27x + /* And similarly for the extra regs on the PXA27x */ + ICMR2 = 0; + ICLR2 = 0; + GFER3 = 0; + GRER3 = 0; + GEDR3 = GEDR3; +#endif + + /* only unmasked interrupts kick us out of idle */ + ICCR = 1; /* GPIO 0 and 1 must have their mask bit always set */ GPIO_IRQ_mask[0] = 3; + for (irq = PXA_IRQ(PXA_IRQ_SKIP); irq <= PXA_IRQ(31); irq++) { + set_irq_chip(irq, &pxa_internal_chip_low); + set_irq_handler(irq, handle_level_irq); + set_irq_flags(irq, IRQF_VALID); + } + +#if PXA_INTERNAL_IRQS > 32 + for (irq = PXA_IRQ(32); irq < PXA_IRQ(PXA_INTERNAL_IRQS); irq++) { + set_irq_chip(irq, &pxa_internal_chip_high); + set_irq_handler(irq, handle_level_irq); + set_irq_flags(irq, IRQF_VALID); + } +#endif + for (irq = IRQ_GPIO0; irq <= IRQ_GPIO1; irq++) { set_irq_chip(irq, &pxa_low_gpio_chip); set_irq_handler(irq, handle_edge_irq); set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); } - for (irq = IRQ_GPIO(2); irq <= IRQ_GPIO(gpio_nr); irq++) { + for (irq = IRQ_GPIO(2); irq <= IRQ_GPIO(PXA_LAST_GPIO); irq++) { set_irq_chip(irq, &pxa_muxed_gpio_chip); set_irq_handler(irq, handle_edge_irq); set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); diff --git a/trunk/arch/arm/mach-pxa/lpd270.c b/trunk/arch/arm/mach-pxa/lpd270.c index 26116440a7c9..e3097664ffe1 100644 --- a/trunk/arch/arm/mach-pxa/lpd270.c +++ b/trunk/arch/arm/mach-pxa/lpd270.c @@ -46,7 +46,6 @@ #include #include "generic.h" -#include "devices.h" static unsigned int lpd270_irq_enabled; @@ -98,7 +97,7 @@ static void __init lpd270_init_irq(void) { int irq; - pxa27x_init_irq(); + pxa_init_irq(); __raw_writew(0, LPD270_INT_MASK); __raw_writew(0, LPD270_INT_STATUS); diff --git a/trunk/arch/arm/mach-pxa/lubbock.c b/trunk/arch/arm/mach-pxa/lubbock.c index e70048fd00a5..6377b2e29ff0 100644 --- a/trunk/arch/arm/mach-pxa/lubbock.c +++ b/trunk/arch/arm/mach-pxa/lubbock.c @@ -48,7 +48,6 @@ #include #include "generic.h" -#include "devices.h" #define LUB_MISC_WR __LUB_REG(LUBBOCK_FPGA_PHYS + 0x080) @@ -104,7 +103,7 @@ static void __init lubbock_init_irq(void) { int irq; - pxa25x_init_irq(); + pxa_init_irq(); /* setup extra lubbock irqs */ for (irq = LUBBOCK_IRQ(0); irq <= LUBBOCK_LAST_IRQ; irq++) { diff --git a/trunk/arch/arm/mach-pxa/mainstone.c b/trunk/arch/arm/mach-pxa/mainstone.c index b02c79c7e6a3..ed99a81b98f3 100644 --- a/trunk/arch/arm/mach-pxa/mainstone.c +++ b/trunk/arch/arm/mach-pxa/mainstone.c @@ -46,7 +46,6 @@ #include #include "generic.h" -#include "devices.h" static unsigned long mainstone_irq_enabled; @@ -90,7 +89,7 @@ static void __init mainstone_init_irq(void) { int irq; - pxa27x_init_irq(); + pxa_init_irq(); /* setup extra Mainstone irqs */ for(irq = MAINSTONE_IRQ(0); irq <= MAINSTONE_IRQ(15); irq++) { diff --git a/trunk/arch/arm/mach-pxa/pm.c b/trunk/arch/arm/mach-pxa/pm.c index e66dbc26add1..6bf15ae73848 100644 --- a/trunk/arch/arm/mach-pxa/pm.c +++ b/trunk/arch/arm/mach-pxa/pm.c @@ -77,6 +77,7 @@ int pxa_pm_enter(suspend_state_t state) { unsigned long sleep_save[SLEEP_SAVE_SIZE]; unsigned long checksum = 0; + struct timespec delta, rtc; int i; extern void pxa_cpu_pm_enter(suspend_state_t state); @@ -86,6 +87,11 @@ int pxa_pm_enter(suspend_state_t state) iwmmxt_task_disable(NULL); #endif + /* preserve current time */ + rtc.tv_sec = RCNR; + rtc.tv_nsec = 0; + save_time_delta(&delta, &rtc); + SAVE(GPLR0); SAVE(GPLR1); SAVE(GPLR2); SAVE(GPDR0); SAVE(GPDR1); SAVE(GPDR2); SAVE(GRER0); SAVE(GRER1); SAVE(GRER2); @@ -177,6 +183,10 @@ int pxa_pm_enter(suspend_state_t state) RESTORE(PSTR); + /* restore current time */ + rtc.tv_sec = RCNR; + restore_time_delta(&delta, &rtc); + #ifdef DEBUG printk(KERN_DEBUG "*** made it back from resume\n"); #endif @@ -190,3 +200,40 @@ unsigned long sleep_phys_sp(void *sp) { return virt_to_phys(sp); } + +/* + * Called after processes are frozen, but before we shut down devices. + */ +int pxa_pm_prepare(suspend_state_t state) +{ + extern int pxa_cpu_pm_prepare(suspend_state_t state); + + return pxa_cpu_pm_prepare(state); +} + +EXPORT_SYMBOL_GPL(pxa_pm_prepare); + +/* + * Called after devices are re-setup, but before processes are thawed. + */ +int pxa_pm_finish(suspend_state_t state) +{ + return 0; +} + +EXPORT_SYMBOL_GPL(pxa_pm_finish); + +static struct pm_ops pxa_pm_ops = { + .prepare = pxa_pm_prepare, + .enter = pxa_pm_enter, + .finish = pxa_pm_finish, + .valid = pm_valid_only_mem, +}; + +static int __init pxa_pm_init(void) +{ + pm_set_ops(&pxa_pm_ops); + return 0; +} + +device_initcall(pxa_pm_init); diff --git a/trunk/arch/arm/mach-pxa/poodle.c b/trunk/arch/arm/mach-pxa/poodle.c index 655668d4d0e9..34fb80b37023 100644 --- a/trunk/arch/arm/mach-pxa/poodle.c +++ b/trunk/arch/arm/mach-pxa/poodle.c @@ -45,7 +45,6 @@ #include #include "generic.h" -#include "devices.h" #include "sharpsl.h" static struct resource poodle_scoop_resources[] = { @@ -413,7 +412,7 @@ MACHINE_START(POODLE, "SHARP Poodle") .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, .fixup = fixup_poodle, .map_io = pxa_map_io, - .init_irq = pxa25x_init_irq, + .init_irq = pxa_init_irq, .timer = &pxa_timer, .init_machine = poodle_init, MACHINE_END diff --git a/trunk/arch/arm/mach-pxa/pxa25x.c b/trunk/arch/arm/mach-pxa/pxa25x.c index f36ca448338e..c1f21739bf71 100644 --- a/trunk/arch/arm/mach-pxa/pxa25x.c +++ b/trunk/arch/arm/mach-pxa/pxa25x.c @@ -19,17 +19,12 @@ #include #include #include -#include #include #include -#include #include -#include -#include #include "generic.h" -#include "devices.h" /* * Various clock factors driven by the CCCR register. @@ -110,6 +105,18 @@ EXPORT_SYMBOL(get_lcdclk_frequency_10khz); #ifdef CONFIG_PM +int pxa_cpu_pm_prepare(suspend_state_t state) +{ + switch (state) { + case PM_SUSPEND_MEM: + break; + default: + return -EINVAL; + } + + return 0; +} + void pxa_cpu_pm_enter(suspend_state_t state) { extern void pxa_cpu_suspend(unsigned int); @@ -126,49 +133,4 @@ void pxa_cpu_pm_enter(suspend_state_t state) } } -static struct pm_ops pxa25x_pm_ops = { - .enter = pxa_pm_enter, - .valid = pm_valid_only_mem, -}; -#endif - -void __init pxa25x_init_irq(void) -{ - pxa_init_irq_low(); - pxa_init_irq_gpio(85); -} - -static struct platform_device *pxa25x_devices[] __initdata = { - &pxamci_device, - &pxaudc_device, - &pxafb_device, - &ffuart_device, - &btuart_device, - &stuart_device, - &pxai2c_device, - &pxai2s_device, - &pxaficp_device, - &pxartc_device, -}; - -static int __init pxa25x_init(void) -{ - int ret = 0; - - if (cpu_is_pxa21x() || cpu_is_pxa25x()) { - if ((ret = pxa_init_dma(16))) - return ret; -#ifdef CONFIG_PM - pm_set_ops(&pxa25x_pm_ops); #endif - ret = platform_add_devices(pxa25x_devices, - ARRAY_SIZE(pxa25x_devices)); - } - /* Only add HWUART for PXA255/26x; PXA210/250/27x do not have it. */ - if (cpu_is_pxa25x()) - ret = platform_device_register(&hwuart_device); - - return ret; -} - -subsys_initcall(pxa25x_init); diff --git a/trunk/arch/arm/mach-pxa/pxa27x.c b/trunk/arch/arm/mach-pxa/pxa27x.c index aa5bb02c897b..1939acc3f9f7 100644 --- a/trunk/arch/arm/mach-pxa/pxa27x.c +++ b/trunk/arch/arm/mach-pxa/pxa27x.c @@ -19,14 +19,10 @@ #include #include -#include #include #include -#include -#include #include "generic.h" -#include "devices.h" /* Crystal clock: 13MHz */ #define BASE_CLK 13000000 @@ -126,6 +122,17 @@ EXPORT_SYMBOL(get_lcdclk_frequency_10khz); #ifdef CONFIG_PM +int pxa_cpu_pm_prepare(suspend_state_t state) +{ + switch (state) { + case PM_SUSPEND_MEM: + case PM_SUSPEND_STANDBY: + return 0; + default: + return -EINVAL; + } +} + void pxa_cpu_pm_enter(suspend_state_t state) { extern void pxa_cpu_standby(void); @@ -155,15 +162,6 @@ void pxa_cpu_pm_enter(suspend_state_t state) } } -static int pxa27x_pm_valid(suspend_state_t state) -{ - return state == PM_SUSPEND_MEM || state == PM_SUSPEND_STANDBY; -} - -static struct pm_ops pxa27x_pm_ops = { - .enter = pxa_pm_enter, - .valid = pxa27x_pm_valid, -}; #endif /* @@ -185,7 +183,7 @@ static struct resource pxa27x_ohci_resources[] = { }, }; -static struct platform_device pxaohci_device = { +static struct platform_device ohci_device = { .name = "pxa27x-ohci", .id = -1, .dev = { @@ -198,62 +196,16 @@ static struct platform_device pxaohci_device = { void __init pxa_set_ohci_info(struct pxaohci_platform_data *info) { - pxaohci_device.dev.platform_data = info; + ohci_device.dev.platform_data = info; } -static struct resource i2c_power_resources[] = { - { - .start = 0x40f00180, - .end = 0x40f001a3, - .flags = IORESOURCE_MEM, - }, { - .start = IRQ_PWRI2C, - .end = IRQ_PWRI2C, - .flags = IORESOURCE_IRQ, - }, -}; - -static struct platform_device pxai2c_power_device = { - .name = "pxa2xx-i2c", - .id = 1, - .resource = i2c_power_resources, - .num_resources = ARRAY_SIZE(i2c_power_resources), -}; - static struct platform_device *devices[] __initdata = { - &pxamci_device, - &pxaudc_device, - &pxafb_device, - &ffuart_device, - &btuart_device, - &stuart_device, - &pxai2c_device, - &pxai2c_power_device, - &pxai2s_device, - &pxaficp_device, - &pxartc_device, - &pxaohci_device, + &ohci_device, }; -void __init pxa27x_init_irq(void) -{ - pxa_init_irq_low(); - pxa_init_irq_high(); - pxa_init_irq_gpio(128); -} - static int __init pxa27x_init(void) { - int ret = 0; - if (cpu_is_pxa27x()) { - if ((ret = pxa_init_dma(32))) - return ret; -#ifdef CONFIG_PM - pm_set_ops(&pxa27x_pm_ops); -#endif - ret = platform_add_devices(devices, ARRAY_SIZE(devices)); - } - return ret; + return platform_add_devices(devices, ARRAY_SIZE(devices)); } subsys_initcall(pxa27x_init); diff --git a/trunk/arch/arm/mach-pxa/spitz.c b/trunk/arch/arm/mach-pxa/spitz.c index bae47e145de8..3cbac63bed3c 100644 --- a/trunk/arch/arm/mach-pxa/spitz.c +++ b/trunk/arch/arm/mach-pxa/spitz.c @@ -48,7 +48,6 @@ #include #include "generic.h" -#include "devices.h" #include "sharpsl.h" /* @@ -561,7 +560,7 @@ MACHINE_START(SPITZ, "SHARP Spitz") .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, .fixup = fixup_spitz, .map_io = pxa_map_io, - .init_irq = pxa27x_init_irq, + .init_irq = pxa_init_irq, .init_machine = spitz_init, .timer = &pxa_timer, MACHINE_END @@ -573,7 +572,7 @@ MACHINE_START(BORZOI, "SHARP Borzoi") .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, .fixup = fixup_spitz, .map_io = pxa_map_io, - .init_irq = pxa27x_init_irq, + .init_irq = pxa_init_irq, .init_machine = spitz_init, .timer = &pxa_timer, MACHINE_END @@ -585,7 +584,7 @@ MACHINE_START(AKITA, "SHARP Akita") .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, .fixup = fixup_spitz, .map_io = pxa_map_io, - .init_irq = pxa27x_init_irq, + .init_irq = pxa_init_irq, .init_machine = akita_init, .timer = &pxa_timer, MACHINE_END diff --git a/trunk/arch/arm/mach-pxa/time.c b/trunk/arch/arm/mach-pxa/time.c index 6f91fd2d061a..5248abe334d2 100644 --- a/trunk/arch/arm/mach-pxa/time.c +++ b/trunk/arch/arm/mach-pxa/time.c @@ -30,6 +30,11 @@ #include +static inline unsigned long pxa_get_rtc_time(void) +{ + return RCNR; +} + static int pxa_set_rtc(void) { unsigned long current_time = xtime.tv_sec; @@ -117,6 +122,10 @@ static void __init pxa_timer_init(void) set_rtc = pxa_set_rtc; + tv.tv_nsec = 0; + tv.tv_sec = pxa_get_rtc_time(); + do_settimeofday(&tv); + OIER = 0; /* disable any timer interrupts */ OSSR = 0xf; /* clear status on all timers */ setup_irq(IRQ_OST0, &pxa_timer_irq); diff --git a/trunk/arch/arm/mach-pxa/tosa.c b/trunk/arch/arm/mach-pxa/tosa.c index 240fd042083d..72738771fb57 100644 --- a/trunk/arch/arm/mach-pxa/tosa.c +++ b/trunk/arch/arm/mach-pxa/tosa.c @@ -42,7 +42,7 @@ #include #include "generic.h" -#include "devices.h" + /* * SCOOP Device @@ -332,7 +332,7 @@ MACHINE_START(TOSA, "SHARP Tosa") .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, .fixup = fixup_tosa, .map_io = pxa_map_io, - .init_irq = pxa25x_init_irq, + .init_irq = pxa_init_irq, .init_machine = tosa_init, .timer = &pxa_timer, MACHINE_END diff --git a/trunk/arch/arm/mach-pxa/trizeps4.c b/trunk/arch/arm/mach-pxa/trizeps4.c index e4ba43bdf85d..28c79bd0a3a0 100644 --- a/trunk/arch/arm/mach-pxa/trizeps4.c +++ b/trunk/arch/arm/mach-pxa/trizeps4.c @@ -49,7 +49,6 @@ #include #include "generic.h" -#include "devices.h" /******************************************************************************************** * ONBOARD FLASH @@ -504,7 +503,7 @@ MACHINE_START(TRIZEPS4, "Keith und Koep Trizeps IV module") .boot_params = TRIZEPS4_SDRAM_BASE + 0x100, .init_machine = trizeps4_init, .map_io = trizeps4_map_io, - .init_irq = pxa27x_init_irq, + .init_irq = pxa_init_irq, .timer = &pxa_timer, MACHINE_END diff --git a/trunk/arch/arm/mach-s3c2440/mach-anubis.c b/trunk/arch/arm/mach-s3c2440/mach-anubis.c index bff7ddd06a52..64456f9a0f6d 100644 --- a/trunk/arch/arm/mach-s3c2440/mach-anubis.c +++ b/trunk/arch/arm/mach-s3c2440/mach-anubis.c @@ -42,6 +42,8 @@ #include #include +#include + #include #include #include @@ -260,6 +262,38 @@ static struct platform_device anubis_device_ide1 = { .resource = anubis_ide1_resource, }; +/* Asix AX88796 10/100 ethernet controller */ + +static struct ax_plat_data anubis_asix_platdata = { + .flags = AXFLG_MAC_FROMDEV, + .wordlength = 2, + .dcr_val = 0x48, + .rcr_val = 0x40, +}; + +static struct resource anubis_asix_resource[] = { + [0] = { + .start = S3C2410_CS5, + .end = S3C2410_CS5 + (0x20 * 0x20) -1, + .flags = IORESOURCE_MEM + }, + [1] = { + .start = IRQ_ASIX, + .end = IRQ_ASIX, + .flags = IORESOURCE_IRQ + } +}; + +static struct platform_device anubis_device_asix = { + .name = "ax88796", + .id = 0, + .num_resources = ARRAY_SIZE(anubis_asix_resource), + .resource = anubis_asix_resource, + .dev = { + .platform_data = &anubis_asix_platdata, + } +}; + /* Standard Anubis devices */ static struct platform_device *anubis_devices[] __initdata = { @@ -271,6 +305,7 @@ static struct platform_device *anubis_devices[] __initdata = { &s3c_device_nand, &anubis_device_ide0, &anubis_device_ide1, + &anubis_device_asix, }; static struct clk *anubis_clocks[] = { diff --git a/trunk/drivers/mmc/host/pxamci.h b/trunk/drivers/mmc/host/pxamci.h index df17c281278a..1b163220df2b 100644 --- a/trunk/drivers/mmc/host/pxamci.h +++ b/trunk/drivers/mmc/host/pxamci.h @@ -1,3 +1,25 @@ +#undef MMC_STRPCL +#undef MMC_STAT +#undef MMC_CLKRT +#undef MMC_SPI +#undef MMC_CMDAT +#undef MMC_RESTO +#undef MMC_RDTO +#undef MMC_BLKLEN +#undef MMC_NOB +#undef MMC_PRTBUF +#undef MMC_I_MASK +#undef END_CMD_RES +#undef PRG_DONE +#undef DATA_TRAN_DONE +#undef MMC_I_REG +#undef MMC_CMD +#undef MMC_ARGH +#undef MMC_ARGL +#undef MMC_RES +#undef MMC_RXFIFO +#undef MMC_TXFIFO + #define MMC_STRPCL 0x0000 #define STOP_CLOCK (1 << 0) #define START_CLOCK (2 << 0) diff --git a/trunk/include/asm-arm/arch-pxa/dma.h b/trunk/include/asm-arm/arch-pxa/dma.h index 3280ee2ddfa5..bed042d71d68 100644 --- a/trunk/include/asm-arm/arch-pxa/dma.h +++ b/trunk/include/asm-arm/arch-pxa/dma.h @@ -30,12 +30,30 @@ typedef enum { DMA_PRIO_LOW = 2 } pxa_dma_prio; +#if defined(CONFIG_PXA27x) + +#define PXA_DMA_CHANNELS 32 + +#define pxa_for_each_dma_prio(ch, prio) \ +for ( \ + ch = prio * 4; \ + ch != (4 << prio) + 16; \ + ch = (ch + 1 == (4 << prio)) ? (prio * 4 + 16) : (ch + 1) \ +) + +#elif defined(CONFIG_PXA25x) + +#define PXA_DMA_CHANNELS 16 + +#define pxa_for_each_dma_prio(ch, prio) \ + for (ch = prio * 4; ch != (4 << prio); ch++) + +#endif + /* * DMA registration */ -int __init pxa_init_dma(int num_ch); - int pxa_request_dma (char *name, pxa_dma_prio prio, void (*irq_handler)(int, void *), diff --git a/trunk/include/asm-arm/arch-pxa/entry-macro.S b/trunk/include/asm-arm/arch-pxa/entry-macro.S index b7e730851461..1d5fbb9b379a 100644 --- a/trunk/include/asm-arm/arch-pxa/entry-macro.S +++ b/trunk/include/asm-arm/arch-pxa/entry-macro.S @@ -20,38 +20,20 @@ .endm .macro get_irqnr_and_base, irqnr, irqstat, base, tmp - mrc p15, 0, \tmp, c0, c0, 0 @ CPUID - mov \tmp, \tmp, lsr #13 - and \tmp, \tmp, #0x7 @ Core G - cmp \tmp, #1 - bhi 1004f - +#ifdef CONFIG_PXA27x + mrc p6, 0, \irqstat, c0, c0, 0 @ ICIP + mrc p6, 0, \irqnr, c1, c0, 0 @ ICMR +#else mov \base, #io_p2v(0x40000000) @ IIR Ctl = 0x40d00000 add \base, \base, #0x00d00000 ldr \irqstat, [\base, #0] @ ICIP ldr \irqnr, [\base, #4] @ ICMR - b 1002f - -1004: - mrc p6, 0, \irqstat, c6, c0, 0 @ ICIP2 - mrc p6, 0, \irqnr, c7, c0, 0 @ ICMR2 - ands \irqstat, \irqstat, \irqnr - beq 1003f - rsb \irqstat, \irqnr, #0 - and \irqstat, \irqstat, \irqnr - clz \irqnr, \irqstat - rsb \irqnr, \irqnr, #31 - add \irqnr, \irqnr, #32 - b 1001f -1003: - mrc p6, 0, \irqstat, c0, c0, 0 @ ICIP - mrc p6, 0, \irqnr, c1, c0, 0 @ ICMR -1002: +#endif ands \irqnr, \irqstat, \irqnr beq 1001f rsb \irqstat, \irqnr, #0 and \irqstat, \irqstat, \irqnr clz \irqnr, \irqstat - rsb \irqnr, \irqnr, #31 + rsb \irqnr, \irqnr, #(31 - PXA_IRQ_SKIP) 1001: .endm diff --git a/trunk/include/asm-arm/arch-pxa/hardware.h b/trunk/include/asm-arm/arch-pxa/hardware.h index 386121746417..e2bdc2fbede1 100644 --- a/trunk/include/asm-arm/arch-pxa/hardware.h +++ b/trunk/include/asm-arm/arch-pxa/hardware.h @@ -62,42 +62,6 @@ #ifndef __ASSEMBLY__ -#define __cpu_is_pxa21x(id) \ - ({ \ - unsigned int _id = (id) >> 4 & 0xf3f; \ - _id == 0x212; \ - }) - -#define __cpu_is_pxa25x(id) \ - ({ \ - unsigned int _id = (id) >> 4 & 0xfff; \ - _id == 0x2d0 || _id == 0x290; \ - }) - -#define __cpu_is_pxa27x(id) \ - ({ \ - unsigned int _id = (id) >> 4 & 0xfff; \ - _id == 0x411; \ - }) - -#define cpu_is_pxa21x() \ - ({ \ - unsigned int id = read_cpuid(CPUID_ID); \ - __cpu_is_pxa21x(id); \ - }) - -#define cpu_is_pxa25x() \ - ({ \ - unsigned int id = read_cpuid(CPUID_ID); \ - __cpu_is_pxa25x(id); \ - }) - -#define cpu_is_pxa27x() \ - ({ \ - unsigned int id = read_cpuid(CPUID_ID); \ - __cpu_is_pxa27x(id); \ - }) - /* * Handy routine to set GPIO alternate functions */ diff --git a/trunk/include/asm-arm/arch-pxa/irqs.h b/trunk/include/asm-arm/arch-pxa/irqs.h index a07fe0f928cd..67ed43674c63 100644 --- a/trunk/include/asm-arm/arch-pxa/irqs.h +++ b/trunk/include/asm-arm/arch-pxa/irqs.h @@ -11,9 +11,14 @@ */ -#define PXA_IRQ(x) (x) - #ifdef CONFIG_PXA27x +#define PXA_IRQ_SKIP 0 +#else +#define PXA_IRQ_SKIP 7 +#endif + +#define PXA_IRQ(x) ((x) - PXA_IRQ_SKIP) + #define IRQ_SSP3 PXA_IRQ(0) /* SSP3 service request */ #define IRQ_MSL PXA_IRQ(1) /* MSL Interface interrupt */ #define IRQ_USBH2 PXA_IRQ(2) /* USB Host interrupt 1 (OHCI) */ @@ -21,8 +26,6 @@ #define IRQ_KEYPAD PXA_IRQ(4) /* Key pad controller */ #define IRQ_MEMSTK PXA_IRQ(5) /* Memory Stick interrupt */ #define IRQ_PWRI2C PXA_IRQ(6) /* Power I2C interrupt */ -#endif - #define IRQ_HWUART PXA_IRQ(7) /* HWUART Transmit/Receive/Error (PXA26x) */ #define IRQ_OST_4_11 PXA_IRQ(7) /* OS timer 4-11 matches (PXA27x) */ #define IRQ_GPIO0 PXA_IRQ(8) /* GPIO0 Edge Detect */ @@ -55,15 +58,18 @@ #ifdef CONFIG_PXA27x #define IRQ_TPM PXA_IRQ(32) /* TPM interrupt */ #define IRQ_CAMERA PXA_IRQ(33) /* Camera Interface */ -#endif -#define PXA_GPIO_IRQ_BASE (64) -#define PXA_GPIO_IRQ_NUM (128) +#define PXA_INTERNAL_IRQS 34 +#else +#define PXA_INTERNAL_IRQS 32 +#endif -#define GPIO_2_x_TO_IRQ(x) (PXA_GPIO_IRQ_BASE + (x)) +#define GPIO_2_x_TO_IRQ(x) \ + PXA_IRQ((x) - 2 + PXA_INTERNAL_IRQS) #define IRQ_GPIO(x) (((x) < 2) ? (IRQ_GPIO0 + (x)) : GPIO_2_x_TO_IRQ(x)) -#define IRQ_TO_GPIO_2_x(i) ((i) - PXA_GPIO_IRQ_BASE) +#define IRQ_TO_GPIO_2_x(i) \ + ((i) - IRQ_GPIO(2) + 2) #define IRQ_TO_GPIO(i) (((i) < IRQ_GPIO(2)) ? ((i) - IRQ_GPIO0) : IRQ_TO_GPIO_2_x(i)) #if defined(CONFIG_PXA25x) @@ -78,7 +84,7 @@ * these. If you need more, increase IRQ_BOARD_END, but keep it * within sensible limits. */ -#define IRQ_BOARD_START (PXA_GPIO_IRQ_BASE + PXA_GPIO_IRQ_NUM) +#define IRQ_BOARD_START (IRQ_GPIO(PXA_LAST_GPIO) + 1) #define IRQ_BOARD_END (IRQ_BOARD_START + 16) #define IRQ_SA1111_START (IRQ_BOARD_END) diff --git a/trunk/include/asm-arm/arch-pxa/pm.h b/trunk/include/asm-arm/arch-pxa/pm.h index 52243a62c4e7..7a8a1cdf430d 100644 --- a/trunk/include/asm-arm/arch-pxa/pm.h +++ b/trunk/include/asm-arm/arch-pxa/pm.h @@ -9,3 +9,4 @@ extern int pxa_pm_prepare(suspend_state_t state); extern int pxa_pm_enter(suspend_state_t state); +extern int pxa_pm_finish(suspend_state_t state); diff --git a/trunk/include/asm-arm/arch-pxa/pxa-regs.h b/trunk/include/asm-arm/arch-pxa/pxa-regs.h index e68b593d69da..dbcc9298b0c8 100644 --- a/trunk/include/asm-arm/arch-pxa/pxa-regs.h +++ b/trunk/include/asm-arm/arch-pxa/pxa-regs.h @@ -1765,9 +1765,29 @@ #define SSACD_P(x) (*(((x) == 1) ? &SSACD_P1 : ((x) == 2) ? &SSACD_P2 : ((x) == 3) ? &SSACD_P3 : NULL)) /* - * MultiMediaCard (MMC) controller - see drivers/mmc/host/pxamci.h + * MultiMediaCard (MMC) controller */ +#define MMC_STRPCL __REG(0x41100000) /* Control to start and stop MMC clock */ +#define MMC_STAT __REG(0x41100004) /* MMC Status Register (read only) */ +#define MMC_CLKRT __REG(0x41100008) /* MMC clock rate */ +#define MMC_SPI __REG(0x4110000c) /* SPI mode control bits */ +#define MMC_CMDAT __REG(0x41100010) /* Command/response/data sequence control */ +#define MMC_RESTO __REG(0x41100014) /* Expected response time out */ +#define MMC_RDTO __REG(0x41100018) /* Expected data read time out */ +#define MMC_BLKLEN __REG(0x4110001c) /* Block length of data transaction */ +#define MMC_NOB __REG(0x41100020) /* Number of blocks, for block mode */ +#define MMC_PRTBUF __REG(0x41100024) /* Partial MMC_TXFIFO FIFO written */ +#define MMC_I_MASK __REG(0x41100028) /* Interrupt Mask */ +#define MMC_I_REG __REG(0x4110002c) /* Interrupt Register (read only) */ +#define MMC_CMD __REG(0x41100030) /* Index of current command */ +#define MMC_ARGH __REG(0x41100034) /* MSW part of the current command argument */ +#define MMC_ARGL __REG(0x41100038) /* LSW part of the current command argument */ +#define MMC_RES __REG(0x4110003c) /* Response FIFO (read only) */ +#define MMC_RXFIFO __REG(0x41100040) /* Receive FIFO (read only) */ +#define MMC_TXFIFO __REG(0x41100044) /* Transmit FIFO (write only) */ + + /* * Core Clock */