Skip to content

Commit f405425

Browse files
committed
Merge branch 'ixp4xx' of git://git.kernel.org/pub/scm/linux/kernel/git/chris/linux-2.6
* 'ixp4xx' of git://git.kernel.org/pub/scm/linux/kernel/git/chris/linux-2.6: IXP4xx: GTWX5715 platform only has two PCI IRQ lines, not four. IXP4xx: Introduce IXP4XX_GPIO_IRQ(n) macro and convert IXP4xx platform files. IXP4xx: move Gemtek GTWX5715 platform macros to the platform code. IXP4xx: Remove unused Motorola PrPMC1100 platform macros. IXP4xx: move FSG platform macros to the platform code. IXP4xx: move DSM G600 platform macros to the platform code. IXP4xx: move NAS100D platform macros to the platform code. IXP4xx: move NSLU2 platform macros to the platform code. IXP4xx: move Coyote platform macros to the platform code. IXP4xx: move AVILA platform macros to the platform code. IXP4xx: move IXDP425 platform macros to the platform code. IXP4xx: Extend PCI MMIO indirect address space to 1 GB. IXP4xx: Fix compilation failure with CONFIG_IXP4XX_INDIRECT_PCI. IXP4xx: Drop "__ixp4xx_" prefix from in/out/ioread/iowrite functions for clarity. IXP4xx: Rename indirect MMIO primitives from __ixp4xx_* to __indirect_*. IXP4xx: Ensure index is positive in irq_to_gpio() and npe_request(). ARM: fix insl() and outsl() endianness on IXP4xx architecture. IXP4xx: Fix normally-disabled debugging text in drivers/net/arm/ixp4xx_eth.c. IXP4xx: change the timer base frequency to 66.666000 MHz.
2 parents f01eb36 + 0fd7dc7 commit f405425

38 files changed

Lines changed: 461 additions & 911 deletions

‎arch/arm/mach-ixp4xx/Kconfig‎

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -179,21 +179,21 @@ config IXP4XX_INDIRECT_PCI
179179
help
180180
IXP4xx provides two methods of accessing PCI memory space:
181181

182-
1) A direct mapped window from 0x48000000 to 0x4bffffff (64MB).
182+
1) A direct mapped window from 0x48000000 to 0x4BFFFFFF (64MB).
183183
To access PCI via this space, we simply ioremap() the BAR
184184
into the kernel and we can use the standard read[bwl]/write[bwl]
185185
macros. This is the preferred method due to speed but it
186-
limits the system to just 64MB of PCI memory. This can be
186+
limits the system to just 64MB of PCI memory. This can be
187187
problematic if using video cards and other memory-heavy devices.
188-
189-
2) If > 64MB of memory space is required, the IXP4xx can be
190-
configured to use indirect registers to access PCI This allows
191-
for up to 128MB (0x48000000 to 0x4fffffff) of memory on the bus.
192-
The disadvantage of this is that every PCI access requires
193-
three local register accesses plus a spinlock, but in some
194-
cases the performance hit is acceptable. In addition, you cannot
195-
mmap() PCI devices in this case due to the indirect nature
196-
of the PCI window.
188+
189+
2) If > 64MB of memory space is required, the IXP4xx can be
190+
configured to use indirect registers to access the whole PCI
191+
memory space. This currently allows for up to 1 GB (0x10000000
192+
to 0x4FFFFFFF) of memory on the bus. The disadvantage of this
193+
is that every PCI access requires three local register accesses
194+
plus a spinlock, but in some cases the performance hit is
195+
acceptable. In addition, you cannot mmap() PCI devices in this
196+
case due to the indirect nature of the PCI window.
197197

198198
By default, the direct method is used. Choose this option if you
199199
need to use the indirect method instead. If you don't know

‎arch/arm/mach-ixp4xx/avila-pci.c‎

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -22,40 +22,45 @@
2222
#include <linux/init.h>
2323
#include <linux/irq.h>
2424
#include <linux/delay.h>
25-
2625
#include <asm/mach/pci.h>
2726
#include <asm/irq.h>
2827
#include <mach/hardware.h>
2928
#include <asm/mach-types.h>
3029

30+
#define AVILA_MAX_DEV 4
31+
#define LOFT_MAX_DEV 6
32+
#define IRQ_LINES 4
33+
34+
/* PCI controller GPIO to IRQ pin mappings */
35+
#define INTA 11
36+
#define INTB 10
37+
#define INTC 9
38+
#define INTD 8
39+
3140
void __init avila_pci_preinit(void)
3241
{
33-
set_irq_type(IRQ_AVILA_PCI_INTA, IRQ_TYPE_LEVEL_LOW);
34-
set_irq_type(IRQ_AVILA_PCI_INTB, IRQ_TYPE_LEVEL_LOW);
35-
set_irq_type(IRQ_AVILA_PCI_INTC, IRQ_TYPE_LEVEL_LOW);
36-
set_irq_type(IRQ_AVILA_PCI_INTD, IRQ_TYPE_LEVEL_LOW);
37-
42+
set_irq_type(IXP4XX_GPIO_IRQ(INTA), IRQ_TYPE_LEVEL_LOW);
43+
set_irq_type(IXP4XX_GPIO_IRQ(INTB), IRQ_TYPE_LEVEL_LOW);
44+
set_irq_type(IXP4XX_GPIO_IRQ(INTC), IRQ_TYPE_LEVEL_LOW);
45+
set_irq_type(IXP4XX_GPIO_IRQ(INTD), IRQ_TYPE_LEVEL_LOW);
3846
ixp4xx_pci_preinit();
3947
}
4048

4149
static int __init avila_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
4250
{
43-
static int pci_irq_table[AVILA_PCI_IRQ_LINES] = {
44-
IRQ_AVILA_PCI_INTA,
45-
IRQ_AVILA_PCI_INTB,
46-
IRQ_AVILA_PCI_INTC,
47-
IRQ_AVILA_PCI_INTD
51+
static int pci_irq_table[IRQ_LINES] = {
52+
IXP4XX_GPIO_IRQ(INTA),
53+
IXP4XX_GPIO_IRQ(INTB),
54+
IXP4XX_GPIO_IRQ(INTC),
55+
IXP4XX_GPIO_IRQ(INTD)
4856
};
4957

50-
int irq = -1;
51-
5258
if (slot >= 1 &&
53-
slot <= (machine_is_loft() ? LOFT_PCI_MAX_DEV : AVILA_PCI_MAX_DEV) &&
54-
pin >= 1 && pin <= AVILA_PCI_IRQ_LINES) {
55-
irq = pci_irq_table[(slot + pin - 2) % 4];
56-
}
59+
slot <= (machine_is_loft() ? LOFT_MAX_DEV : AVILA_MAX_DEV) &&
60+
pin >= 1 && pin <= IRQ_LINES)
61+
return pci_irq_table[(slot + pin - 2) % 4];
5762

58-
return irq;
63+
return -1;
5964
}
6065

6166
struct hw_pci avila_pci __initdata = {
@@ -75,4 +80,3 @@ int __init avila_pci_init(void)
7580
}
7681

7782
subsys_initcall(avila_pci_init);
78-

‎arch/arm/mach-ixp4xx/avila-setup.c‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#include <linux/serial_8250.h>
2020
#include <linux/slab.h>
2121
#include <linux/i2c-gpio.h>
22-
2322
#include <asm/types.h>
2423
#include <asm/setup.h>
2524
#include <asm/memory.h>
@@ -29,6 +28,9 @@
2928
#include <asm/mach/arch.h>
3029
#include <asm/mach/flash.h>
3130

31+
#define AVILA_SDA_PIN 7
32+
#define AVILA_SCL_PIN 6
33+
3234
static struct flash_platform_data avila_flash_data = {
3335
.map_name = "cfi_probe",
3436
.width = 2,

‎arch/arm/mach-ixp4xx/common-pci.c‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -481,11 +481,7 @@ int ixp4xx_setup(int nr, struct pci_sys_data *sys)
481481

482482
res[1].name = "PCI Memory Space";
483483
res[1].start = PCIBIOS_MIN_MEM;
484-
#ifndef CONFIG_IXP4XX_INDIRECT_PCI
485-
res[1].end = 0x4bffffff;
486-
#else
487-
res[1].end = 0x4fffffff;
488-
#endif
484+
res[1].end = PCIBIOS_MAX_MEM;
489485
res[1].flags = IORESOURCE_MEM;
490486

491487
request_resource(&ioport_resource, &res[0]);

‎arch/arm/mach-ixp4xx/common.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ int gpio_to_irq(int gpio)
117117
}
118118
EXPORT_SYMBOL(gpio_to_irq);
119119

120-
int irq_to_gpio(int irq)
120+
int irq_to_gpio(unsigned int irq)
121121
{
122122
int gpio = (irq < 32) ? irq2gpio[irq] : -EINVAL;
123123

‎arch/arm/mach-ixp4xx/coyote-pci.c‎

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,27 +18,31 @@
1818
#include <linux/pci.h>
1919
#include <linux/init.h>
2020
#include <linux/irq.h>
21-
2221
#include <asm/mach-types.h>
2322
#include <mach/hardware.h>
2423
#include <asm/irq.h>
25-
2624
#include <asm/mach/pci.h>
2725

26+
#define SLOT0_DEVID 14
27+
#define SLOT1_DEVID 15
28+
29+
/* PCI controller GPIO to IRQ pin mappings */
30+
#define SLOT0_INTA 6
31+
#define SLOT1_INTA 11
32+
2833
void __init coyote_pci_preinit(void)
2934
{
30-
set_irq_type(IRQ_COYOTE_PCI_SLOT0, IRQ_TYPE_LEVEL_LOW);
31-
set_irq_type(IRQ_COYOTE_PCI_SLOT1, IRQ_TYPE_LEVEL_LOW);
32-
35+
set_irq_type(IXP4XX_GPIO_IRQ(SLOT0_INTA), IRQ_TYPE_LEVEL_LOW);
36+
set_irq_type(IXP4XX_GPIO_IRQ(SLOT1_INTA), IRQ_TYPE_LEVEL_LOW);
3337
ixp4xx_pci_preinit();
3438
}
3539

3640
static int __init coyote_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
3741
{
38-
if (slot == COYOTE_PCI_SLOT0_DEVID)
39-
return IRQ_COYOTE_PCI_SLOT0;
40-
else if (slot == COYOTE_PCI_SLOT1_DEVID)
41-
return IRQ_COYOTE_PCI_SLOT1;
42+
if (slot == SLOT0_DEVID)
43+
return IXP4XX_GPIO_IRQ(SLOT0_INTA);
44+
else if (slot == SLOT1_DEVID)
45+
return IXP4XX_GPIO_IRQ(SLOT1_INTA);
4246
else return -1;
4347
}
4448

‎arch/arm/mach-ixp4xx/coyote-setup.c‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,15 @@
2525
#include <asm/mach/arch.h>
2626
#include <asm/mach/flash.h>
2727

28+
#define COYOTE_IDE_BASE_PHYS IXP4XX_EXP_BUS_BASE(3)
29+
#define COYOTE_IDE_BASE_VIRT 0xFFFE1000
30+
#define COYOTE_IDE_REGION_SIZE 0x1000
31+
32+
#define COYOTE_IDE_DATA_PORT 0xFFFE10E0
33+
#define COYOTE_IDE_CTRL_PORT 0xFFFE10FC
34+
#define COYOTE_IDE_ERROR_PORT 0xFFFE10E2
35+
#define IRQ_COYOTE_IDE IRQ_IXP4XX_GPIO5
36+
2837
static struct flash_platform_data coyote_flash_data = {
2938
.map_name = "cfi_probe",
3039
.width = 2,

‎arch/arm/mach-ixp4xx/dsmg600-pci.c‎

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -19,39 +19,45 @@
1919
#include <linux/pci.h>
2020
#include <linux/init.h>
2121
#include <linux/irq.h>
22-
2322
#include <asm/mach/pci.h>
2423
#include <asm/mach-types.h>
2524

25+
#define MAX_DEV 4
26+
#define IRQ_LINES 3
27+
28+
/* PCI controller GPIO to IRQ pin mappings */
29+
#define INTA 11
30+
#define INTB 10
31+
#define INTC 9
32+
#define INTD 8
33+
#define INTE 7
34+
#define INTF 6
35+
2636
void __init dsmg600_pci_preinit(void)
2737
{
28-
set_irq_type(IRQ_DSMG600_PCI_INTA, IRQ_TYPE_LEVEL_LOW);
29-
set_irq_type(IRQ_DSMG600_PCI_INTB, IRQ_TYPE_LEVEL_LOW);
30-
set_irq_type(IRQ_DSMG600_PCI_INTC, IRQ_TYPE_LEVEL_LOW);
31-
set_irq_type(IRQ_DSMG600_PCI_INTD, IRQ_TYPE_LEVEL_LOW);
32-
set_irq_type(IRQ_DSMG600_PCI_INTE, IRQ_TYPE_LEVEL_LOW);
33-
set_irq_type(IRQ_DSMG600_PCI_INTF, IRQ_TYPE_LEVEL_LOW);
34-
38+
set_irq_type(IXP4XX_GPIO_IRQ(INTA), IRQ_TYPE_LEVEL_LOW);
39+
set_irq_type(IXP4XX_GPIO_IRQ(INTB), IRQ_TYPE_LEVEL_LOW);
40+
set_irq_type(IXP4XX_GPIO_IRQ(INTC), IRQ_TYPE_LEVEL_LOW);
41+
set_irq_type(IXP4XX_GPIO_IRQ(INTD), IRQ_TYPE_LEVEL_LOW);
42+
set_irq_type(IXP4XX_GPIO_IRQ(INTE), IRQ_TYPE_LEVEL_LOW);
43+
set_irq_type(IXP4XX_GPIO_IRQ(INTF), IRQ_TYPE_LEVEL_LOW);
3544
ixp4xx_pci_preinit();
3645
}
3746

3847
static int __init dsmg600_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
3948
{
40-
static int pci_irq_table[DSMG600_PCI_MAX_DEV][DSMG600_PCI_IRQ_LINES] =
41-
{
42-
{ IRQ_DSMG600_PCI_INTE, -1, -1 },
43-
{ IRQ_DSMG600_PCI_INTA, -1, -1 },
44-
{ IRQ_DSMG600_PCI_INTB, IRQ_DSMG600_PCI_INTC, IRQ_DSMG600_PCI_INTD },
45-
{ IRQ_DSMG600_PCI_INTF, -1, -1 },
49+
static int pci_irq_table[MAX_DEV][IRQ_LINES] = {
50+
{ IXP4XX_GPIO_IRQ(INTE), -1, -1 },
51+
{ IXP4XX_GPIO_IRQ(INTA), -1, -1 },
52+
{ IXP4XX_GPIO_IRQ(INTB), IXP4XX_GPIO_IRQ(INTC),
53+
IXP4XX_GPIO_IRQ(INTD) },
54+
{ IXP4XX_GPIO_IRQ(INTF), -1, -1 },
4655
};
4756

48-
int irq = -1;
49-
50-
if (slot >= 1 && slot <= DSMG600_PCI_MAX_DEV &&
51-
pin >= 1 && pin <= DSMG600_PCI_IRQ_LINES)
52-
irq = pci_irq_table[slot-1][pin-1];
57+
if (slot >= 1 && slot <= MAX_DEV && pin >= 1 && pin <= IRQ_LINES)
58+
return pci_irq_table[slot - 1][pin - 1];
5359

54-
return irq;
60+
return -1;
5561
}
5662

5763
struct hw_pci __initdata dsmg600_pci = {

‎arch/arm/mach-ixp4xx/dsmg600-setup.c‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,23 @@
3333
#include <asm/mach/time.h>
3434
#include <asm/gpio.h>
3535

36+
#define DSMG600_SDA_PIN 5
37+
#define DSMG600_SCL_PIN 4
38+
39+
/* DSM-G600 Timer Setting */
40+
#define DSMG600_FREQ 66000000
41+
42+
/* Buttons */
43+
#define DSMG600_PB_GPIO 15 /* power button */
44+
#define DSMG600_RB_GPIO 3 /* reset button */
45+
46+
/* Power control */
47+
#define DSMG600_PO_GPIO 2 /* power off */
48+
49+
/* LEDs */
50+
#define DSMG600_LED_PWR_GPIO 0
51+
#define DSMG600_LED_WLAN_GPIO 14
52+
3653
static struct flash_platform_data dsmg600_flash_data = {
3754
.map_name = "cfi_probe",
3855
.width = 2,

‎arch/arm/mach-ixp4xx/fsg-pci.c‎

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,33 +19,38 @@
1919
#include <linux/pci.h>
2020
#include <linux/init.h>
2121
#include <linux/irq.h>
22-
2322
#include <asm/mach/pci.h>
2423
#include <asm/mach-types.h>
2524

25+
#define MAX_DEV 3
26+
#define IRQ_LINES 3
27+
28+
/* PCI controller GPIO to IRQ pin mappings */
29+
#define INTA 6
30+
#define INTB 7
31+
#define INTC 5
32+
2633
void __init fsg_pci_preinit(void)
2734
{
28-
set_irq_type(IRQ_FSG_PCI_INTA, IRQ_TYPE_LEVEL_LOW);
29-
set_irq_type(IRQ_FSG_PCI_INTB, IRQ_TYPE_LEVEL_LOW);
30-
set_irq_type(IRQ_FSG_PCI_INTC, IRQ_TYPE_LEVEL_LOW);
31-
35+
set_irq_type(IXP4XX_GPIO_IRQ(INTA), IRQ_TYPE_LEVEL_LOW);
36+
set_irq_type(IXP4XX_GPIO_IRQ(INTB), IRQ_TYPE_LEVEL_LOW);
37+
set_irq_type(IXP4XX_GPIO_IRQ(INTC), IRQ_TYPE_LEVEL_LOW);
3238
ixp4xx_pci_preinit();
3339
}
3440

3541
static int __init fsg_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
3642
{
37-
static int pci_irq_table[FSG_PCI_IRQ_LINES] = {
38-
IRQ_FSG_PCI_INTC,
39-
IRQ_FSG_PCI_INTB,
40-
IRQ_FSG_PCI_INTA,
43+
static int pci_irq_table[IRQ_LINES] = {
44+
IXP4XX_GPIO_IRQ(INTC),
45+
IXP4XX_GPIO_IRQ(INTB),
46+
IXP4XX_GPIO_IRQ(INTA),
4147
};
4248

4349
int irq = -1;
44-
slot = slot - 11;
50+
slot -= 11;
4551

46-
if (slot >= 1 && slot <= FSG_PCI_MAX_DEV &&
47-
pin >= 1 && pin <= FSG_PCI_IRQ_LINES)
48-
irq = pci_irq_table[(slot - 1)];
52+
if (slot >= 1 && slot <= MAX_DEV && pin >= 1 && pin <= IRQ_LINES)
53+
irq = pci_irq_table[slot - 1];
4954
printk(KERN_INFO "%s: Mapped slot %d pin %d to IRQ %d\n",
5055
__func__, slot, pin, irq);
5156

0 commit comments

Comments
 (0)