aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-pxa/cm-x270-pci.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-pxa/cm-x270-pci.c')
-rw-r--r--arch/arm/mach-pxa/cm-x270-pci.c49
1 files changed, 26 insertions, 23 deletions
diff --git a/arch/arm/mach-pxa/cm-x270-pci.c b/arch/arm/mach-pxa/cm-x270-pci.c
index ac7f05f9f3eb..bcf0cde6ccc9 100644
--- a/arch/arm/mach-pxa/cm-x270-pci.c
+++ b/arch/arm/mach-pxa/cm-x270-pci.c
@@ -5,7 +5,7 @@
5 * 5 *
6 * Bits taken from various places. 6 * Bits taken from various places.
7 * 7 *
8 * Copyright (C) 2007 Compulab, Ltd. 8 * Copyright (C) 2007, 2008 Compulab, Ltd.
9 * Mike Rapoport <mike@compulab.co.il> 9 * Mike Rapoport <mike@compulab.co.il>
10 * 10 *
11 * This program is free software; you can redistribute it and/or modify 11 * This program is free software; you can redistribute it and/or modify
@@ -19,16 +19,16 @@
19#include <linux/device.h> 19#include <linux/device.h>
20#include <linux/platform_device.h> 20#include <linux/platform_device.h>
21#include <linux/irq.h> 21#include <linux/irq.h>
22#include <linux/gpio.h>
22 23
23#include <asm/mach/pci.h> 24#include <asm/mach/pci.h>
24#include <asm/arch/cm-x270.h>
25#include <asm/arch/pxa-regs.h> 25#include <asm/arch/pxa-regs.h>
26#include <asm/arch/pxa2xx-gpio.h>
27#include <asm/mach-types.h> 26#include <asm/mach-types.h>
28 27
29#include <asm/hardware/it8152.h> 28#include <asm/hardware/it8152.h>
30 29
31unsigned long it8152_base_address = CMX270_IT8152_VIRT; 30unsigned long it8152_base_address;
31static int cmx270_it8152_irq_gpio;
32 32
33/* 33/*
34 * Only first 64MB of memory can be accessed via PCI. 34 * Only first 64MB of memory can be accessed via PCI.
@@ -41,36 +41,39 @@ void __init cmx270_pci_adjust_zones(int node, unsigned long *zone_size,
41{ 41{
42 unsigned int sz = SZ_64M >> PAGE_SHIFT; 42 unsigned int sz = SZ_64M >> PAGE_SHIFT;
43 43
44 pr_info("Adjusting zones for CM-x270\n"); 44 if (machine_is_armcore()) {
45 pr_info("Adjusting zones for CM-X270\n");
45 46
46 /* 47 /*
47 * Only adjust if > 64M on current system 48 * Only adjust if > 64M on current system
48 */ 49 */
49 if (node || (zone_size[0] <= sz)) 50 if (node || (zone_size[0] <= sz))
50 return; 51 return;
51 52
52 zone_size[1] = zone_size[0] - sz; 53 zone_size[1] = zone_size[0] - sz;
53 zone_size[0] = sz; 54 zone_size[0] = sz;
54 zhole_size[1] = zhole_size[0]; 55 zhole_size[1] = zhole_size[0];
55 zhole_size[0] = 0; 56 zhole_size[0] = 0;
57 }
56} 58}
57 59
58static void cmx270_it8152_irq_demux(unsigned int irq, struct irq_desc *desc) 60static void cmx270_it8152_irq_demux(unsigned int irq, struct irq_desc *desc)
59{ 61{
60 /* clear our parent irq */ 62 /* clear our parent irq */
61 GEDR(GPIO_IT8152_IRQ) = GPIO_bit(GPIO_IT8152_IRQ); 63 GEDR(cmx270_it8152_irq_gpio) = GPIO_bit(cmx270_it8152_irq_gpio);
62 64
63 it8152_irq_demux(irq, desc); 65 it8152_irq_demux(irq, desc);
64} 66}
65 67
66void __cmx270_pci_init_irq(void) 68void __cmx270_pci_init_irq(int irq_gpio)
67{ 69{
68 it8152_init_irq(); 70 it8152_init_irq();
69 pxa_gpio_mode(IRQ_TO_GPIO(GPIO_IT8152_IRQ));
70 set_irq_type(IRQ_GPIO(GPIO_IT8152_IRQ), IRQT_RISING);
71 71
72 set_irq_chained_handler(IRQ_GPIO(GPIO_IT8152_IRQ), 72 cmx270_it8152_irq_gpio = irq_gpio;
73 cmx270_it8152_irq_demux); 73
74 set_irq_type(gpio_to_irq(irq_gpio), IRQT_RISING);
75
76 set_irq_chained_handler(gpio_to_irq(irq_gpio), cmx270_it8152_irq_demux);
74} 77}
75 78
76#ifdef CONFIG_PM 79#ifdef CONFIG_PM
@@ -113,8 +116,8 @@ static int __init cmx270_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
113 116
114 /* 117 /*
115 Here comes the ugly part. The routing is baseboard specific, 118 Here comes the ugly part. The routing is baseboard specific,
116 but defining a platform for each possible base of CM-x270 is 119 but defining a platform for each possible base of CM-X270 is
117 unrealistic. Here we keep mapping for ATXBase and SB-x270. 120 unrealistic. Here we keep mapping for ATXBase and SB-X270.
118 */ 121 */
119 /* ATXBASE PCI slot */ 122 /* ATXBASE PCI slot */
120 if (slot == 7) 123 if (slot == 7)