Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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.

+461 -911
+11 -11
arch/arm/mach-ixp4xx/Kconfig
··· 179 179 help 180 180 IXP4xx provides two methods of accessing PCI memory space: 181 181 182 - 1) A direct mapped window from 0x48000000 to 0x4bffffff (64MB). 182 + 1) A direct mapped window from 0x48000000 to 0x4BFFFFFF (64MB). 183 183 To access PCI via this space, we simply ioremap() the BAR 184 184 into the kernel and we can use the standard read[bwl]/write[bwl] 185 185 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 187 187 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. 197 197 198 198 By default, the direct method is used. Choose this option if you 199 199 need to use the indirect method instead. If you don't know
+23 -19
arch/arm/mach-ixp4xx/avila-pci.c
··· 22 22 #include <linux/init.h> 23 23 #include <linux/irq.h> 24 24 #include <linux/delay.h> 25 - 26 25 #include <asm/mach/pci.h> 27 26 #include <asm/irq.h> 28 27 #include <mach/hardware.h> 29 28 #include <asm/mach-types.h> 30 29 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 + 31 40 void __init avila_pci_preinit(void) 32 41 { 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); 38 46 ixp4xx_pci_preinit(); 39 47 } 40 48 41 49 static int __init avila_map_irq(struct pci_dev *dev, u8 slot, u8 pin) 42 50 { 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) 48 56 }; 49 57 50 - int irq = -1; 51 - 52 58 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]; 57 62 58 - return irq; 63 + return -1; 59 64 } 60 65 61 66 struct hw_pci avila_pci __initdata = { ··· 80 75 } 81 76 82 77 subsys_initcall(avila_pci_init); 83 -
+3 -1
arch/arm/mach-ixp4xx/avila-setup.c
··· 19 19 #include <linux/serial_8250.h> 20 20 #include <linux/slab.h> 21 21 #include <linux/i2c-gpio.h> 22 - 23 22 #include <asm/types.h> 24 23 #include <asm/setup.h> 25 24 #include <asm/memory.h> ··· 27 28 #include <asm/irq.h> 28 29 #include <asm/mach/arch.h> 29 30 #include <asm/mach/flash.h> 31 + 32 + #define AVILA_SDA_PIN 7 33 + #define AVILA_SCL_PIN 6 30 34 31 35 static struct flash_platform_data avila_flash_data = { 32 36 .map_name = "cfi_probe",
+1 -5
arch/arm/mach-ixp4xx/common-pci.c
··· 481 481 482 482 res[1].name = "PCI Memory Space"; 483 483 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; 489 485 res[1].flags = IORESOURCE_MEM; 490 486 491 487 request_resource(&ioport_resource, &res[0]);
+1 -1
arch/arm/mach-ixp4xx/common.c
··· 117 117 } 118 118 EXPORT_SYMBOL(gpio_to_irq); 119 119 120 - int irq_to_gpio(int irq) 120 + int irq_to_gpio(unsigned int irq) 121 121 { 122 122 int gpio = (irq < 32) ? irq2gpio[irq] : -EINVAL; 123 123
+13 -9
arch/arm/mach-ixp4xx/coyote-pci.c
··· 18 18 #include <linux/pci.h> 19 19 #include <linux/init.h> 20 20 #include <linux/irq.h> 21 - 22 21 #include <asm/mach-types.h> 23 22 #include <mach/hardware.h> 24 23 #include <asm/irq.h> 25 - 26 24 #include <asm/mach/pci.h> 25 + 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 27 32 28 33 void __init coyote_pci_preinit(void) 29 34 { 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); 33 37 ixp4xx_pci_preinit(); 34 38 } 35 39 36 40 static int __init coyote_map_irq(struct pci_dev *dev, u8 slot, u8 pin) 37 41 { 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); 42 46 else return -1; 43 47 } 44 48
+9
arch/arm/mach-ixp4xx/coyote-setup.c
··· 25 25 #include <asm/mach/arch.h> 26 26 #include <asm/mach/flash.h> 27 27 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 + 28 37 static struct flash_platform_data coyote_flash_data = { 29 38 .map_name = "cfi_probe", 30 39 .width = 2,
+26 -20
arch/arm/mach-ixp4xx/dsmg600-pci.c
··· 19 19 #include <linux/pci.h> 20 20 #include <linux/init.h> 21 21 #include <linux/irq.h> 22 - 23 22 #include <asm/mach/pci.h> 24 23 #include <asm/mach-types.h> 25 24 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 + 26 36 void __init dsmg600_pci_preinit(void) 27 37 { 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); 35 44 ixp4xx_pci_preinit(); 36 45 } 37 46 38 47 static int __init dsmg600_map_irq(struct pci_dev *dev, u8 slot, u8 pin) 39 48 { 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 }, 46 55 }; 47 56 48 - int irq = -1; 57 + if (slot >= 1 && slot <= MAX_DEV && pin >= 1 && pin <= IRQ_LINES) 58 + return pci_irq_table[slot - 1][pin - 1]; 49 59 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]; 53 - 54 - return irq; 60 + return -1; 55 61 } 56 62 57 63 struct hw_pci __initdata dsmg600_pci = {
+17
arch/arm/mach-ixp4xx/dsmg600-setup.c
··· 33 33 #include <asm/mach/time.h> 34 34 #include <asm/gpio.h> 35 35 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 + 36 53 static struct flash_platform_data dsmg600_flash_data = { 37 54 .map_name = "cfi_probe", 38 55 .width = 2,
+18 -13
arch/arm/mach-ixp4xx/fsg-pci.c
··· 19 19 #include <linux/pci.h> 20 20 #include <linux/init.h> 21 21 #include <linux/irq.h> 22 - 23 22 #include <asm/mach/pci.h> 24 23 #include <asm/mach-types.h> 25 24 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 + 26 33 void __init fsg_pci_preinit(void) 27 34 { 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); 32 38 ixp4xx_pci_preinit(); 33 39 } 34 40 35 41 static int __init fsg_map_irq(struct pci_dev *dev, u8 slot, u8 pin) 36 42 { 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), 41 47 }; 42 48 43 49 int irq = -1; 44 - slot = slot - 11; 50 + slot -= 11; 45 51 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]; 49 54 printk(KERN_INFO "%s: Mapped slot %d pin %d to IRQ %d\n", 50 55 __func__, slot, pin, irq); 51 56
+7 -1
arch/arm/mach-ixp4xx/fsg-setup.c
··· 24 24 #include <linux/i2c.h> 25 25 #include <linux/i2c-gpio.h> 26 26 #include <linux/io.h> 27 - 28 27 #include <asm/mach-types.h> 29 28 #include <asm/mach/arch.h> 30 29 #include <asm/mach/flash.h> 31 30 #include <asm/gpio.h> 31 + 32 + #define FSG_SDA_PIN 12 33 + #define FSG_SCL_PIN 13 34 + 35 + #define FSG_SB_GPIO 4 /* sync button */ 36 + #define FSG_RB_GPIO 9 /* reset button */ 37 + #define FSG_UB_GPIO 10 /* usb button */ 32 38 33 39 static struct flash_platform_data fsg_flash_data = { 34 40 .map_name = "cfi_probe",
+22 -23
arch/arm/mach-ixp4xx/goramo_mlr.c
··· 17 17 #include <asm/mach/flash.h> 18 18 #include <asm/mach/pci.h> 19 19 20 - #define xgpio_irq(n) (IRQ_IXP4XX_GPIO ## n) 21 - #define gpio_irq(n) xgpio_irq(n) 22 - 23 20 #define SLOT_ETHA 0x0B /* IDSEL = AD21 */ 24 21 #define SLOT_ETHB 0x0C /* IDSEL = AD20 */ 25 22 #define SLOT_MPCI 0x0D /* IDSEL = AD19 */ 26 23 #define SLOT_NEC 0x0E /* IDSEL = AD18 */ 27 24 28 - #define IRQ_ETHA IRQ_IXP4XX_GPIO4 29 - #define IRQ_ETHB IRQ_IXP4XX_GPIO5 30 - #define IRQ_NEC IRQ_IXP4XX_GPIO3 31 - #define IRQ_MPCI IRQ_IXP4XX_GPIO12 32 - 33 25 /* GPIO lines */ 34 26 #define GPIO_SCL 0 35 27 #define GPIO_SDA 1 36 28 #define GPIO_STR 2 29 + #define GPIO_IRQ_NEC 3 30 + #define GPIO_IRQ_ETHA 4 31 + #define GPIO_IRQ_ETHB 5 37 32 #define GPIO_HSS0_DCD_N 6 38 33 #define GPIO_HSS1_DCD_N 7 34 + #define GPIO_UART0_DCD 8 35 + #define GPIO_UART1_DCD 9 39 36 #define GPIO_HSS0_CTS_N 10 40 37 #define GPIO_HSS1_CTS_N 11 38 + #define GPIO_IRQ_MPCI 12 41 39 #define GPIO_HSS1_RTS_N 13 42 40 #define GPIO_HSS0_RTS_N 14 41 + /* GPIO15 is not connected */ 43 42 44 43 /* Control outputs from 74HC4094 */ 45 44 #define CONTROL_HSS0_CLK_INT 0 ··· 151 152 152 153 static irqreturn_t hss_dcd_irq(int irq, void *pdev) 153 154 { 154 - int i, port = (irq == gpio_irq(GPIO_HSS1_DCD_N)); 155 + int i, port = (irq == IXP4XX_GPIO_IRQ(GPIO_HSS1_DCD_N)); 155 156 gpio_line_get(port ? GPIO_HSS1_DCD_N : GPIO_HSS0_DCD_N, &i); 156 157 set_carrier_cb_tab[port](pdev, !i); 157 158 return IRQ_HANDLED; ··· 164 165 int i, irq; 165 166 166 167 if (!port) 167 - irq = gpio_irq(GPIO_HSS0_DCD_N); 168 + irq = IXP4XX_GPIO_IRQ(GPIO_HSS0_DCD_N); 168 169 else 169 - irq = gpio_irq(GPIO_HSS1_DCD_N); 170 + irq = IXP4XX_GPIO_IRQ(GPIO_HSS1_DCD_N); 170 171 171 172 gpio_line_get(port ? GPIO_HSS1_DCD_N : GPIO_HSS0_DCD_N, &i); 172 173 set_carrier_cb(pdev, !i); ··· 187 188 188 189 static void hss_close(int port, void *pdev) 189 190 { 190 - free_irq(port ? gpio_irq(GPIO_HSS1_DCD_N) : gpio_irq(GPIO_HSS0_DCD_N), 191 - pdev); 191 + free_irq(port ? IXP4XX_GPIO_IRQ(GPIO_HSS1_DCD_N) : 192 + IXP4XX_GPIO_IRQ(GPIO_HSS0_DCD_N), pdev); 192 193 set_carrier_cb_tab[!!port] = NULL; /* catch bugs */ 193 194 194 195 set_control(port ? CONTROL_HSS1_DTR_N : CONTROL_HSS0_DTR_N, 1); ··· 420 421 gpio_line_config(GPIO_HSS1_RTS_N, IXP4XX_GPIO_OUT); 421 422 gpio_line_config(GPIO_HSS0_DCD_N, IXP4XX_GPIO_IN); 422 423 gpio_line_config(GPIO_HSS1_DCD_N, IXP4XX_GPIO_IN); 423 - set_irq_type(gpio_irq(GPIO_HSS0_DCD_N), IRQ_TYPE_EDGE_BOTH); 424 - set_irq_type(gpio_irq(GPIO_HSS1_DCD_N), IRQ_TYPE_EDGE_BOTH); 424 + set_irq_type(IXP4XX_GPIO_IRQ(GPIO_HSS0_DCD_N), IRQ_TYPE_EDGE_BOTH); 425 + set_irq_type(IXP4XX_GPIO_IRQ(GPIO_HSS1_DCD_N), IRQ_TYPE_EDGE_BOTH); 425 426 426 427 set_control(CONTROL_HSS0_DTR_N, 1); 427 428 set_control(CONTROL_HSS1_DTR_N, 1); ··· 441 442 #ifdef CONFIG_PCI 442 443 static void __init gmlr_pci_preinit(void) 443 444 { 444 - set_irq_type(IRQ_ETHA, IRQ_TYPE_LEVEL_LOW); 445 - set_irq_type(IRQ_ETHB, IRQ_TYPE_LEVEL_LOW); 446 - set_irq_type(IRQ_NEC, IRQ_TYPE_LEVEL_LOW); 447 - set_irq_type(IRQ_MPCI, IRQ_TYPE_LEVEL_LOW); 445 + set_irq_type(IXP4XX_GPIO_IRQ(GPIO_IRQ_ETHA), IRQ_TYPE_LEVEL_LOW); 446 + set_irq_type(IXP4XX_GPIO_IRQ(GPIO_IRQ_ETHB), IRQ_TYPE_LEVEL_LOW); 447 + set_irq_type(IXP4XX_GPIO_IRQ(GPIO_IRQ_NEC), IRQ_TYPE_LEVEL_LOW); 448 + set_irq_type(IXP4XX_GPIO_IRQ(GPIO_IRQ_MPCI), IRQ_TYPE_LEVEL_LOW); 448 449 ixp4xx_pci_preinit(); 449 450 } 450 451 ··· 465 466 static int __init gmlr_map_irq(struct pci_dev *dev, u8 slot, u8 pin) 466 467 { 467 468 switch(slot) { 468 - case SLOT_ETHA: return IRQ_ETHA; 469 - case SLOT_ETHB: return IRQ_ETHB; 470 - case SLOT_NEC: return IRQ_NEC; 471 - default: return IRQ_MPCI; 469 + case SLOT_ETHA: return IXP4XX_GPIO_IRQ(GPIO_IRQ_ETHA); 470 + case SLOT_ETHB: return IXP4XX_GPIO_IRQ(GPIO_IRQ_ETHB); 471 + case SLOT_NEC: return IXP4XX_GPIO_IRQ(GPIO_IRQ_NEC); 472 + default: return IXP4XX_GPIO_IRQ(GPIO_IRQ_MPCI); 472 473 } 473 474 } 474 475
+17 -23
arch/arm/mach-ixp4xx/gtwx5715-pci.c
··· 26 26 #include <linux/init.h> 27 27 #include <linux/delay.h> 28 28 #include <linux/irq.h> 29 - 30 29 #include <asm/mach-types.h> 31 30 #include <mach/hardware.h> 32 - #include <mach/gtwx5715.h> 33 31 #include <asm/mach/pci.h> 34 32 33 + #define SLOT0_DEVID 0 34 + #define SLOT1_DEVID 1 35 + #define INTA 10 /* slot 1 has INTA and INTB crossed */ 36 + #define INTB 11 37 + 35 38 /* 36 - * The exact GPIO pins and IRQs are defined in arch-ixp4xx/gtwx5715.h 37 39 * Slot 0 isn't actually populated with a card connector but 38 40 * we initialize it anyway in case a future version has the 39 41 * slot populated or someone with good soldering skills has ··· 43 41 */ 44 42 void __init gtwx5715_pci_preinit(void) 45 43 { 46 - set_irq_type(GTWX5715_PCI_SLOT0_INTA_IRQ, IRQ_TYPE_LEVEL_LOW); 47 - set_irq_type(GTWX5715_PCI_SLOT0_INTB_IRQ, IRQ_TYPE_LEVEL_LOW); 48 - set_irq_type(GTWX5715_PCI_SLOT1_INTA_IRQ, IRQ_TYPE_LEVEL_LOW); 49 - set_irq_type(GTWX5715_PCI_SLOT1_INTB_IRQ, IRQ_TYPE_LEVEL_LOW); 50 - 44 + set_irq_type(IXP4XX_GPIO_IRQ(INTA), IRQ_TYPE_LEVEL_LOW); 45 + set_irq_type(IXP4XX_GPIO_IRQ(INTB), IRQ_TYPE_LEVEL_LOW); 51 46 ixp4xx_pci_preinit(); 52 47 } 53 48 54 49 55 50 static int __init gtwx5715_map_irq(struct pci_dev *dev, u8 slot, u8 pin) 56 51 { 57 - int rc; 58 - static int gtwx5715_irqmap 59 - [GTWX5715_PCI_SLOT_COUNT] 60 - [GTWX5715_PCI_INT_PIN_COUNT] = { 61 - {GTWX5715_PCI_SLOT0_INTA_IRQ, GTWX5715_PCI_SLOT0_INTB_IRQ}, 62 - {GTWX5715_PCI_SLOT1_INTA_IRQ, GTWX5715_PCI_SLOT1_INTB_IRQ}, 63 - }; 52 + int rc = -1; 64 53 65 - if (slot >= GTWX5715_PCI_SLOT_COUNT || 66 - pin >= GTWX5715_PCI_INT_PIN_COUNT) rc = -1; 67 - else 68 - rc = gtwx5715_irqmap[slot][pin-1]; 54 + if ((slot == SLOT0_DEVID && pin == 1) || 55 + (slot == SLOT1_DEVID && pin == 2)) 56 + rc = IXP4XX_GPIO_IRQ(INTA); 57 + else if ((slot == SLOT0_DEVID && pin == 2) || 58 + (slot == SLOT1_DEVID && pin == 1)) 59 + rc = IXP4XX_GPIO_IRQ(INTB); 69 60 70 - printk("%s: Mapped slot %d pin %d to IRQ %d\n", __func__, slot, pin, rc); 71 - return(rc); 61 + printk(KERN_INFO "%s: Mapped slot %d pin %d to IRQ %d\n", 62 + __func__, slot, pin, rc); 63 + return rc; 72 64 } 73 65 74 66 struct hw_pci gtwx5715_pci __initdata = { ··· 77 81 int __init gtwx5715_pci_init(void) 78 82 { 79 83 if (machine_is_gtwx5715()) 80 - { 81 84 pci_common_init(&gtwx5715_pci); 82 - } 83 85 84 86 return 0; 85 87 }
+28 -2
arch/arm/mach-ixp4xx/gtwx5715-setup.c
··· 28 28 #include <linux/tty.h> 29 29 #include <linux/serial_8250.h> 30 30 #include <linux/slab.h> 31 - 32 31 #include <asm/types.h> 33 32 #include <asm/setup.h> 34 33 #include <asm/memory.h> ··· 36 37 #include <asm/mach-types.h> 37 38 #include <asm/mach/arch.h> 38 39 #include <asm/mach/flash.h> 39 - #include <mach/gtwx5715.h> 40 + 41 + /* GPIO 5,6,7 and 12 are hard wired to the Kendin KS8995M Switch 42 + and operate as an SPI type interface. The details of the interface 43 + are available on Kendin/Micrel's web site. */ 44 + 45 + #define GTWX5715_KSSPI_SELECT 5 46 + #define GTWX5715_KSSPI_TXD 6 47 + #define GTWX5715_KSSPI_CLOCK 7 48 + #define GTWX5715_KSSPI_RXD 12 49 + 50 + /* The "reset" button is wired to GPIO 3. 51 + The GPIO is brought "low" when the button is pushed. */ 52 + 53 + #define GTWX5715_BUTTON_GPIO 3 54 + 55 + /* Board Label Front Label 56 + LED1 Power 57 + LED2 Wireless-G 58 + LED3 not populated but could be 59 + LED4 Internet 60 + LED5 - LED8 Controlled by KS8995M Switch 61 + LED9 DMZ */ 62 + 63 + #define GTWX5715_LED1_GPIO 2 64 + #define GTWX5715_LED2_GPIO 9 65 + #define GTWX5715_LED3_GPIO 8 66 + #define GTWX5715_LED4_GPIO 1 67 + #define GTWX5715_LED9_GPIO 4 40 68 41 69 /* 42 70 * Xscale UART registers are 32 bits wide with only the least
-39
arch/arm/mach-ixp4xx/include/mach/avila.h
··· 1 - /* 2 - * arch/arm/mach-ixp4xx/include/mach/avila.h 3 - * 4 - * Gateworks Avila platform specific definitions 5 - * 6 - * Author: Michael-Luke Jones <mlj28@cam.ac.uk> 7 - * 8 - * Based on ixdp425.h 9 - * Author: Deepak Saxena <dsaxena@plexity.net> 10 - * 11 - * Copyright 2004 (c) MontaVista, Software, Inc. 12 - * 13 - * This file is licensed under the terms of the GNU General Public 14 - * License version 2. This program is licensed "as is" without any 15 - * warranty of any kind, whether express or implied. 16 - */ 17 - 18 - #ifndef __ASM_ARCH_HARDWARE_H__ 19 - #error "Do not include this directly, instead #include <mach/hardware.h>" 20 - #endif 21 - 22 - #define AVILA_SDA_PIN 7 23 - #define AVILA_SCL_PIN 6 24 - 25 - /* 26 - * AVILA PCI IRQs 27 - */ 28 - #define AVILA_PCI_MAX_DEV 4 29 - #define LOFT_PCI_MAX_DEV 6 30 - #define AVILA_PCI_IRQ_LINES 4 31 - 32 - 33 - /* PCI controller GPIO to IRQ pin mappings */ 34 - #define AVILA_PCI_INTA_PIN 11 35 - #define AVILA_PCI_INTB_PIN 10 36 - #define AVILA_PCI_INTC_PIN 9 37 - #define AVILA_PCI_INTD_PIN 8 38 - 39 -
-33
arch/arm/mach-ixp4xx/include/mach/coyote.h
··· 1 - /* 2 - * arch/arm/mach-ixp4xx/include/mach/coyote.h 3 - * 4 - * ADI Engineering platform specific definitions 5 - * 6 - * Author: Deepak Saxena <dsaxena@plexity.net> 7 - * 8 - * Copyright 2004 (c) MontaVista, Software, Inc. 9 - * 10 - * This file is licensed under the terms of the GNU General Public 11 - * License version 2. This program is licensed "as is" without any 12 - * warranty of any kind, whether express or implied. 13 - */ 14 - 15 - #ifndef __ASM_ARCH_HARDWARE_H__ 16 - #error "Do not include this directly, instead #include <mach/hardware.h>" 17 - #endif 18 - 19 - /* PCI controller GPIO to IRQ pin mappings */ 20 - #define COYOTE_PCI_SLOT0_PIN 6 21 - #define COYOTE_PCI_SLOT1_PIN 11 22 - 23 - #define COYOTE_PCI_SLOT0_DEVID 14 24 - #define COYOTE_PCI_SLOT1_DEVID 15 25 - 26 - #define COYOTE_IDE_BASE_PHYS IXP4XX_EXP_BUS_BASE(3) 27 - #define COYOTE_IDE_BASE_VIRT 0xFFFE1000 28 - #define COYOTE_IDE_REGION_SIZE 0x1000 29 - 30 - #define COYOTE_IDE_DATA_PORT 0xFFFE10E0 31 - #define COYOTE_IDE_CTRL_PORT 0xFFFE10FC 32 - #define COYOTE_IDE_ERROR_PORT 0xFFFE10E2 33 -
-52
arch/arm/mach-ixp4xx/include/mach/dsmg600.h
··· 1 - /* 2 - * DSM-G600 platform specific definitions 3 - * 4 - * Copyright (C) 2006 Tower Technologies 5 - * Author: Alessandro Zummo <a.zummo@towertech.it> 6 - * 7 - * based on ixdp425.h: 8 - * Copyright 2004 (C) MontaVista, Software, Inc. 9 - * 10 - * This file is licensed under the terms of the GNU General Public 11 - * License version 2. This program is licensed "as is" without any 12 - * warranty of any kind, whether express or implied. 13 - */ 14 - 15 - #ifndef __ASM_ARCH_HARDWARE_H__ 16 - #error "Do not include this directly, instead #include <mach/hardware.h>" 17 - #endif 18 - 19 - #define DSMG600_SDA_PIN 5 20 - #define DSMG600_SCL_PIN 4 21 - 22 - /* 23 - * DSMG600 PCI IRQs 24 - */ 25 - #define DSMG600_PCI_MAX_DEV 4 26 - #define DSMG600_PCI_IRQ_LINES 3 27 - 28 - 29 - /* PCI controller GPIO to IRQ pin mappings */ 30 - #define DSMG600_PCI_INTA_PIN 11 31 - #define DSMG600_PCI_INTB_PIN 10 32 - #define DSMG600_PCI_INTC_PIN 9 33 - #define DSMG600_PCI_INTD_PIN 8 34 - #define DSMG600_PCI_INTE_PIN 7 35 - #define DSMG600_PCI_INTF_PIN 6 36 - 37 - /* DSM-G600 Timer Setting */ 38 - #define DSMG600_FREQ 66000000 39 - 40 - /* Buttons */ 41 - 42 - #define DSMG600_PB_GPIO 15 /* power button */ 43 - #define DSMG600_RB_GPIO 3 /* reset button */ 44 - 45 - /* Power control */ 46 - 47 - #define DSMG600_PO_GPIO 2 /* power off */ 48 - 49 - /* LEDs */ 50 - 51 - #define DSMG600_LED_PWR_GPIO 0 52 - #define DSMG600_LED_WLAN_GPIO 14
-50
arch/arm/mach-ixp4xx/include/mach/fsg.h
··· 1 - /* 2 - * arch/arm/mach-ixp4xx/include/mach/fsg.h 3 - * 4 - * Freecom FSG-3 platform specific definitions 5 - * 6 - * Author: Rod Whitby <rod@whitby.id.au> 7 - * Author: Tomasz Chmielewski <mangoo@wpkg.org> 8 - * Maintainers: http://www.nslu2-linux.org 9 - * 10 - * Based on coyote.h by 11 - * Copyright 2004 (c) MontaVista, Software, Inc. 12 - * 13 - * This file is licensed under the terms of the GNU General Public 14 - * License version 2. This program is licensed "as is" without any 15 - * warranty of any kind, whether express or implied. 16 - */ 17 - 18 - #ifndef __ASM_ARCH_HARDWARE_H__ 19 - #error "Do not include this directly, instead #include <mach/hardware.h>" 20 - #endif 21 - 22 - #define FSG_SDA_PIN 12 23 - #define FSG_SCL_PIN 13 24 - 25 - /* 26 - * FSG PCI IRQs 27 - */ 28 - #define FSG_PCI_MAX_DEV 3 29 - #define FSG_PCI_IRQ_LINES 3 30 - 31 - 32 - /* PCI controller GPIO to IRQ pin mappings */ 33 - #define FSG_PCI_INTA_PIN 6 34 - #define FSG_PCI_INTB_PIN 7 35 - #define FSG_PCI_INTC_PIN 5 36 - 37 - /* Buttons */ 38 - 39 - #define FSG_SB_GPIO 4 /* sync button */ 40 - #define FSG_RB_GPIO 9 /* reset button */ 41 - #define FSG_UB_GPIO 10 /* usb button */ 42 - 43 - /* LEDs */ 44 - 45 - #define FSG_LED_WLAN_BIT 0 46 - #define FSG_LED_WAN_BIT 1 47 - #define FSG_LED_SATA_BIT 2 48 - #define FSG_LED_USB_BIT 4 49 - #define FSG_LED_RING_BIT 5 50 - #define FSG_LED_SYNC_BIT 7
+1 -1
arch/arm/mach-ixp4xx/include/mach/gpio.h
··· 70 70 #include <asm-generic/gpio.h> /* cansleep wrappers */ 71 71 72 72 extern int gpio_to_irq(int gpio); 73 - extern int irq_to_gpio(int gpio); 73 + extern int irq_to_gpio(unsigned int irq); 74 74 75 75 #endif 76 76
-116
arch/arm/mach-ixp4xx/include/mach/gtwx5715.h
··· 1 - /* 2 - * arch/arm/mach-ixp4xx/include/mach/gtwx5715.h 3 - * 4 - * Gemtek GTWX5715 Gateway (Linksys WRV54G) 5 - * 6 - * Copyright 2004 (c) George T. Joseph 7 - * 8 - * This program is free software; you can redistribute it and/or 9 - * modify it under the terms of the GNU General Public License 10 - * as published by the Free Software Foundation; either version 2 11 - * of the License, or (at your option) any later version. 12 - * 13 - * This program is distributed in the hope that it will be useful, 14 - * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 - * GNU General Public License for more details. 17 - * 18 - * You should have received a copy of the GNU General Public License 19 - * along with this program; if not, write to the Free Software 20 - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 21 - */ 22 - 23 - #ifndef __ASM_ARCH_HARDWARE_H__ 24 - #error "Do not include this directly, instead #include <mach/hardware.h>" 25 - #endif 26 - #include "irqs.h" 27 - 28 - #define GTWX5715_GPIO0 0 29 - #define GTWX5715_GPIO1 1 30 - #define GTWX5715_GPIO2 2 31 - #define GTWX5715_GPIO3 3 32 - #define GTWX5715_GPIO4 4 33 - #define GTWX5715_GPIO5 5 34 - #define GTWX5715_GPIO6 6 35 - #define GTWX5715_GPIO7 7 36 - #define GTWX5715_GPIO8 8 37 - #define GTWX5715_GPIO9 9 38 - #define GTWX5715_GPIO10 10 39 - #define GTWX5715_GPIO11 11 40 - #define GTWX5715_GPIO12 12 41 - #define GTWX5715_GPIO13 13 42 - #define GTWX5715_GPIO14 14 43 - 44 - #define GTWX5715_GPIO0_IRQ IRQ_IXP4XX_GPIO0 45 - #define GTWX5715_GPIO1_IRQ IRQ_IXP4XX_GPIO1 46 - #define GTWX5715_GPIO2_IRQ IRQ_IXP4XX_GPIO2 47 - #define GTWX5715_GPIO3_IRQ IRQ_IXP4XX_GPIO3 48 - #define GTWX5715_GPIO4_IRQ IRQ_IXP4XX_GPIO4 49 - #define GTWX5715_GPIO5_IRQ IRQ_IXP4XX_GPIO5 50 - #define GTWX5715_GPIO6_IRQ IRQ_IXP4XX_GPIO6 51 - #define GTWX5715_GPIO7_IRQ IRQ_IXP4XX_GPIO7 52 - #define GTWX5715_GPIO8_IRQ IRQ_IXP4XX_GPIO8 53 - #define GTWX5715_GPIO9_IRQ IRQ_IXP4XX_GPIO9 54 - #define GTWX5715_GPIO10_IRQ IRQ_IXP4XX_GPIO10 55 - #define GTWX5715_GPIO11_IRQ IRQ_IXP4XX_GPIO11 56 - #define GTWX5715_GPIO12_IRQ IRQ_IXP4XX_GPIO12 57 - #define GTWX5715_GPIO13_IRQ IRQ_IXP4XX_SW_INT1 58 - #define GTWX5715_GPIO14_IRQ IRQ_IXP4XX_SW_INT2 59 - 60 - /* PCI controller GPIO to IRQ pin mappings 61 - 62 - INTA INTB 63 - SLOT 0 10 11 64 - SLOT 1 11 10 65 - 66 - */ 67 - 68 - #define GTWX5715_PCI_SLOT0_DEVID 0 69 - #define GTWX5715_PCI_SLOT0_INTA_GPIO GTWX5715_GPIO10 70 - #define GTWX5715_PCI_SLOT0_INTB_GPIO GTWX5715_GPIO11 71 - #define GTWX5715_PCI_SLOT0_INTA_IRQ GTWX5715_GPIO10_IRQ 72 - #define GTWX5715_PCI_SLOT0_INTB_IRQ GTWX5715_GPIO11_IRQ 73 - 74 - #define GTWX5715_PCI_SLOT1_DEVID 1 75 - #define GTWX5715_PCI_SLOT1_INTA_GPIO GTWX5715_GPIO11 76 - #define GTWX5715_PCI_SLOT1_INTB_GPIO GTWX5715_GPIO10 77 - #define GTWX5715_PCI_SLOT1_INTA_IRQ GTWX5715_GPIO11_IRQ 78 - #define GTWX5715_PCI_SLOT1_INTB_IRQ GTWX5715_GPIO10_IRQ 79 - 80 - #define GTWX5715_PCI_SLOT_COUNT 2 81 - #define GTWX5715_PCI_INT_PIN_COUNT 2 82 - 83 - /* 84 - * GPIO 5,6,7 and12 are hard wired to the Kendin KS8995M Switch 85 - * and operate as an SPI type interface. The details of the interface 86 - * are available on Kendin/Micrel's web site. 87 - */ 88 - 89 - #define GTWX5715_KSSPI_SELECT GTWX5715_GPIO5 90 - #define GTWX5715_KSSPI_TXD GTWX5715_GPIO6 91 - #define GTWX5715_KSSPI_CLOCK GTWX5715_GPIO7 92 - #define GTWX5715_KSSPI_RXD GTWX5715_GPIO12 93 - 94 - /* 95 - * The "reset" button is wired to GPIO 3. 96 - * The GPIO is brought "low" when the button is pushed. 97 - */ 98 - 99 - #define GTWX5715_BUTTON_GPIO GTWX5715_GPIO3 100 - #define GTWX5715_BUTTON_IRQ GTWX5715_GPIO3_IRQ 101 - 102 - /* 103 - * Board Label Front Label 104 - * LED1 Power 105 - * LED2 Wireless-G 106 - * LED3 not populated but could be 107 - * LED4 Internet 108 - * LED5 - LED8 Controlled by KS8995M Switch 109 - * LED9 DMZ 110 - */ 111 - 112 - #define GTWX5715_LED1_GPIO GTWX5715_GPIO2 113 - #define GTWX5715_LED2_GPIO GTWX5715_GPIO9 114 - #define GTWX5715_LED3_GPIO GTWX5715_GPIO8 115 - #define GTWX5715_LED4_GPIO GTWX5715_GPIO1 116 - #define GTWX5715_LED9_GPIO GTWX5715_GPIO4
+7 -11
arch/arm/mach-ixp4xx/include/mach/hardware.h
··· 18 18 #define __ASM_ARCH_HARDWARE_H__ 19 19 20 20 #define PCIBIOS_MIN_IO 0x00001000 21 - #define PCIBIOS_MIN_MEM (cpu_is_ixp43x() ? 0x40000000 : 0x48000000) 21 + #ifdef CONFIG_IXP4XX_INDIRECT_PCI 22 + #define PCIBIOS_MIN_MEM 0x10000000 /* 1 GB of indirect PCI MMIO space */ 23 + #define PCIBIOS_MAX_MEM 0x4FFFFFFF 24 + #else 25 + #define PCIBIOS_MIN_MEM 0x48000000 /* 64 MB of PCI MMIO space */ 26 + #define PCIBIOS_MAX_MEM 0x4BFFFFFF 27 + #endif 22 28 23 29 /* 24 30 * We override the standard dma-mask routines for bouncing. ··· 42 36 43 37 /* Platform helper functions and definitions */ 44 38 #include "platform.h" 45 - 46 - /* Platform specific details */ 47 - #include "ixdp425.h" 48 - #include "avila.h" 49 - #include "coyote.h" 50 - #include "prpmc1100.h" 51 - #include "nslu2.h" 52 - #include "nas100d.h" 53 - #include "dsmg600.h" 54 - #include "fsg.h" 55 39 56 40 #endif /* _ASM_ARCH_HARDWARE_H */
+133 -174
arch/arm/mach-ixp4xx/include/mach/io.h
··· 26 26 /* 27 27 * IXP4xx provides two methods of accessing PCI memory space: 28 28 * 29 - * 1) A direct mapped window from 0x48000000 to 0x4bffffff (64MB). 29 + * 1) A direct mapped window from 0x48000000 to 0x4BFFFFFF (64MB). 30 30 * To access PCI via this space, we simply ioremap() the BAR 31 31 * into the kernel and we can use the standard read[bwl]/write[bwl] 32 32 * macros. This is the preffered method due to speed but it 33 - * limits the system to just 64MB of PCI memory. This can be 34 - * problamatic if using video cards and other memory-heavy 35 - * targets. 33 + * limits the system to just 64MB of PCI memory. This can be 34 + * problematic if using video cards and other memory-heavy targets. 36 35 * 37 - * 2) If > 64MB of memory space is required, the IXP4xx can be configured 38 - * to use indirect registers to access PCI (as we do below for I/O 39 - * transactions). This allows for up to 128MB (0x48000000 to 0x4fffffff) 40 - * of memory on the bus. The disadvantage of this is that every 41 - * PCI access requires three local register accesses plus a spinlock, 42 - * but in some cases the performance hit is acceptable. In addition, 43 - * you cannot mmap() PCI devices in this case. 44 - * 36 + * 2) If > 64MB of memory space is required, the IXP4xx can use indirect 37 + * registers to access the whole 4 GB of PCI memory space (as we do below 38 + * for I/O transactions). This allows currently for up to 1 GB (0x10000000 39 + * to 0x4FFFFFFF) of memory on the bus. The disadvantage of this is that 40 + * every PCI access requires three local register accesses plus a spinlock, 41 + * but in some cases the performance hit is acceptable. In addition, you 42 + * cannot mmap() PCI devices in this case. 45 43 */ 46 44 #ifndef CONFIG_IXP4XX_INDIRECT_PCI 47 45 ··· 53 55 * access registers. If something outside of PCI is ioremap'd, we 54 56 * fallback to the default. 55 57 */ 56 - static inline void __iomem * 57 - __ixp4xx_ioremap(unsigned long addr, size_t size, unsigned int mtype) 58 + 59 + static inline int is_pci_memory(u32 addr) 58 60 { 59 - if((addr < PCIBIOS_MIN_MEM) || (addr > 0x4fffffff)) 61 + return (addr >= PCIBIOS_MIN_MEM) && (addr <= 0x4FFFFFFF); 62 + } 63 + 64 + static inline void __iomem * __indirect_ioremap(unsigned long addr, size_t size, 65 + unsigned int mtype) 66 + { 67 + if (!is_pci_memory(addr)) 60 68 return __arm_ioremap(addr, size, mtype); 61 69 62 70 return (void __iomem *)addr; 63 71 } 64 72 65 - static inline void 66 - __ixp4xx_iounmap(void __iomem *addr) 73 + static inline void __indirect_iounmap(void __iomem *addr) 67 74 { 68 - if ((__force u32)addr >= VMALLOC_START) 75 + if (!is_pci_memory((__force u32)addr)) 69 76 __iounmap(addr); 70 77 } 71 78 72 - #define __arch_ioremap(a, s, f) __ixp4xx_ioremap(a, s, f) 73 - #define __arch_iounmap(a) __ixp4xx_iounmap(a) 79 + #define __arch_ioremap(a, s, f) __indirect_ioremap(a, s, f) 80 + #define __arch_iounmap(a) __indirect_iounmap(a) 74 81 75 - #define writeb(v, p) __ixp4xx_writeb(v, p) 76 - #define writew(v, p) __ixp4xx_writew(v, p) 77 - #define writel(v, p) __ixp4xx_writel(v, p) 82 + #define writeb(v, p) __indirect_writeb(v, p) 83 + #define writew(v, p) __indirect_writew(v, p) 84 + #define writel(v, p) __indirect_writel(v, p) 78 85 79 - #define writesb(p, v, l) __ixp4xx_writesb(p, v, l) 80 - #define writesw(p, v, l) __ixp4xx_writesw(p, v, l) 81 - #define writesl(p, v, l) __ixp4xx_writesl(p, v, l) 82 - 83 - #define readb(p) __ixp4xx_readb(p) 84 - #define readw(p) __ixp4xx_readw(p) 85 - #define readl(p) __ixp4xx_readl(p) 86 - 87 - #define readsb(p, v, l) __ixp4xx_readsb(p, v, l) 88 - #define readsw(p, v, l) __ixp4xx_readsw(p, v, l) 89 - #define readsl(p, v, l) __ixp4xx_readsl(p, v, l) 86 + #define writesb(p, v, l) __indirect_writesb(p, v, l) 87 + #define writesw(p, v, l) __indirect_writesw(p, v, l) 88 + #define writesl(p, v, l) __indirect_writesl(p, v, l) 90 89 91 - static inline void 92 - __ixp4xx_writeb(u8 value, volatile void __iomem *p) 90 + #define readb(p) __indirect_readb(p) 91 + #define readw(p) __indirect_readw(p) 92 + #define readl(p) __indirect_readl(p) 93 + 94 + #define readsb(p, v, l) __indirect_readsb(p, v, l) 95 + #define readsw(p, v, l) __indirect_readsw(p, v, l) 96 + #define readsl(p, v, l) __indirect_readsl(p, v, l) 97 + 98 + static inline void __indirect_writeb(u8 value, volatile void __iomem *p) 93 99 { 94 100 u32 addr = (u32)p; 95 101 u32 n, byte_enables, data; 96 102 97 - if (addr >= VMALLOC_START) { 103 + if (!is_pci_memory(addr)) { 98 104 __raw_writeb(value, addr); 99 105 return; 100 106 } ··· 109 107 ixp4xx_pci_write(addr, byte_enables | NP_CMD_MEMWRITE, data); 110 108 } 111 109 112 - static inline void 113 - __ixp4xx_writesb(volatile void __iomem *bus_addr, const u8 *vaddr, int count) 110 + static inline void __indirect_writesb(volatile void __iomem *bus_addr, 111 + const u8 *vaddr, int count) 114 112 { 115 113 while (count--) 116 114 writeb(*vaddr++, bus_addr); 117 115 } 118 116 119 - static inline void 120 - __ixp4xx_writew(u16 value, volatile void __iomem *p) 117 + static inline void __indirect_writew(u16 value, volatile void __iomem *p) 121 118 { 122 119 u32 addr = (u32)p; 123 120 u32 n, byte_enables, data; 124 121 125 - if (addr >= VMALLOC_START) { 122 + if (!is_pci_memory(addr)) { 126 123 __raw_writew(value, addr); 127 124 return; 128 125 } ··· 132 131 ixp4xx_pci_write(addr, byte_enables | NP_CMD_MEMWRITE, data); 133 132 } 134 133 135 - static inline void 136 - __ixp4xx_writesw(volatile void __iomem *bus_addr, const u16 *vaddr, int count) 134 + static inline void __indirect_writesw(volatile void __iomem *bus_addr, 135 + const u16 *vaddr, int count) 137 136 { 138 137 while (count--) 139 138 writew(*vaddr++, bus_addr); 140 139 } 141 140 142 - static inline void 143 - __ixp4xx_writel(u32 value, volatile void __iomem *p) 141 + static inline void __indirect_writel(u32 value, volatile void __iomem *p) 144 142 { 145 143 u32 addr = (__force u32)p; 146 - if (addr >= VMALLOC_START) { 144 + 145 + if (!is_pci_memory(addr)) { 147 146 __raw_writel(value, p); 148 147 return; 149 148 } ··· 151 150 ixp4xx_pci_write(addr, NP_CMD_MEMWRITE, value); 152 151 } 153 152 154 - static inline void 155 - __ixp4xx_writesl(volatile void __iomem *bus_addr, const u32 *vaddr, int count) 153 + static inline void __indirect_writesl(volatile void __iomem *bus_addr, 154 + const u32 *vaddr, int count) 156 155 { 157 156 while (count--) 158 157 writel(*vaddr++, bus_addr); 159 158 } 160 159 161 - static inline unsigned char 162 - __ixp4xx_readb(const volatile void __iomem *p) 160 + static inline unsigned char __indirect_readb(const volatile void __iomem *p) 163 161 { 164 162 u32 addr = (u32)p; 165 163 u32 n, byte_enables, data; 166 164 167 - if (addr >= VMALLOC_START) 165 + if (!is_pci_memory(addr)) 168 166 return __raw_readb(addr); 169 167 170 168 n = addr % 4; ··· 174 174 return data >> (8*n); 175 175 } 176 176 177 - static inline void 178 - __ixp4xx_readsb(const volatile void __iomem *bus_addr, u8 *vaddr, u32 count) 177 + static inline void __indirect_readsb(const volatile void __iomem *bus_addr, 178 + u8 *vaddr, u32 count) 179 179 { 180 180 while (count--) 181 181 *vaddr++ = readb(bus_addr); 182 182 } 183 183 184 - static inline unsigned short 185 - __ixp4xx_readw(const volatile void __iomem *p) 184 + static inline unsigned short __indirect_readw(const volatile void __iomem *p) 186 185 { 187 186 u32 addr = (u32)p; 188 187 u32 n, byte_enables, data; 189 188 190 - if (addr >= VMALLOC_START) 189 + if (!is_pci_memory(addr)) 191 190 return __raw_readw(addr); 192 191 193 192 n = addr % 4; ··· 197 198 return data>>(8*n); 198 199 } 199 200 200 - static inline void 201 - __ixp4xx_readsw(const volatile void __iomem *bus_addr, u16 *vaddr, u32 count) 201 + static inline void __indirect_readsw(const volatile void __iomem *bus_addr, 202 + u16 *vaddr, u32 count) 202 203 { 203 204 while (count--) 204 205 *vaddr++ = readw(bus_addr); 205 206 } 206 207 207 - static inline unsigned long 208 - __ixp4xx_readl(const volatile void __iomem *p) 208 + static inline unsigned long __indirect_readl(const volatile void __iomem *p) 209 209 { 210 210 u32 addr = (__force u32)p; 211 211 u32 data; 212 212 213 - if (addr >= VMALLOC_START) 213 + if (!is_pci_memory(addr)) 214 214 return __raw_readl(p); 215 215 216 216 if (ixp4xx_pci_read(addr, NP_CMD_MEMREAD, &data)) ··· 218 220 return data; 219 221 } 220 222 221 - static inline void 222 - __ixp4xx_readsl(const volatile void __iomem *bus_addr, u32 *vaddr, u32 count) 223 + static inline void __indirect_readsl(const volatile void __iomem *bus_addr, 224 + u32 *vaddr, u32 count) 223 225 { 224 226 while (count--) 225 227 *vaddr++ = readl(bus_addr); ··· 233 235 #define memcpy_fromio(a,c,l) _memcpy_fromio((a),(c),(l)) 234 236 #define memcpy_toio(c,a,l) _memcpy_toio((c),(a),(l)) 235 237 236 - #endif 238 + #endif /* CONFIG_IXP4XX_INDIRECT_PCI */ 237 239 238 240 #ifndef CONFIG_PCI 239 241 ··· 248 250 * transaction. This means that we need to override the default 249 251 * I/O functions. 250 252 */ 251 - #define outb(p, v) __ixp4xx_outb(p, v) 252 - #define outw(p, v) __ixp4xx_outw(p, v) 253 - #define outl(p, v) __ixp4xx_outl(p, v) 254 - 255 - #define outsb(p, v, l) __ixp4xx_outsb(p, v, l) 256 - #define outsw(p, v, l) __ixp4xx_outsw(p, v, l) 257 - #define outsl(p, v, l) __ixp4xx_outsl(p, v, l) 258 253 259 - #define inb(p) __ixp4xx_inb(p) 260 - #define inw(p) __ixp4xx_inw(p) 261 - #define inl(p) __ixp4xx_inl(p) 262 - 263 - #define insb(p, v, l) __ixp4xx_insb(p, v, l) 264 - #define insw(p, v, l) __ixp4xx_insw(p, v, l) 265 - #define insl(p, v, l) __ixp4xx_insl(p, v, l) 266 - 267 - 268 - static inline void 269 - __ixp4xx_outb(u8 value, u32 addr) 254 + static inline void outb(u8 value, u32 addr) 270 255 { 271 256 u32 n, byte_enables, data; 272 257 n = addr % 4; ··· 258 277 ixp4xx_pci_write(addr, byte_enables | NP_CMD_IOWRITE, data); 259 278 } 260 279 261 - static inline void 262 - __ixp4xx_outsb(u32 io_addr, const u8 *vaddr, u32 count) 280 + static inline void outsb(u32 io_addr, const u8 *vaddr, u32 count) 263 281 { 264 282 while (count--) 265 283 outb(*vaddr++, io_addr); 266 284 } 267 285 268 - static inline void 269 - __ixp4xx_outw(u16 value, u32 addr) 286 + static inline void outw(u16 value, u32 addr) 270 287 { 271 288 u32 n, byte_enables, data; 272 289 n = addr % 4; ··· 273 294 ixp4xx_pci_write(addr, byte_enables | NP_CMD_IOWRITE, data); 274 295 } 275 296 276 - static inline void 277 - __ixp4xx_outsw(u32 io_addr, const u16 *vaddr, u32 count) 297 + static inline void outsw(u32 io_addr, const u16 *vaddr, u32 count) 278 298 { 279 299 while (count--) 280 300 outw(cpu_to_le16(*vaddr++), io_addr); 281 301 } 282 302 283 - static inline void 284 - __ixp4xx_outl(u32 value, u32 addr) 303 + static inline void outl(u32 value, u32 addr) 285 304 { 286 305 ixp4xx_pci_write(addr, NP_CMD_IOWRITE, value); 287 306 } 288 307 289 - static inline void 290 - __ixp4xx_outsl(u32 io_addr, const u32 *vaddr, u32 count) 308 + static inline void outsl(u32 io_addr, const u32 *vaddr, u32 count) 291 309 { 292 310 while (count--) 293 - outl(*vaddr++, io_addr); 311 + outl(cpu_to_le32(*vaddr++), io_addr); 294 312 } 295 313 296 - static inline u8 297 - __ixp4xx_inb(u32 addr) 314 + static inline u8 inb(u32 addr) 298 315 { 299 316 u32 n, byte_enables, data; 300 317 n = addr % 4; ··· 301 326 return data >> (8*n); 302 327 } 303 328 304 - static inline void 305 - __ixp4xx_insb(u32 io_addr, u8 *vaddr, u32 count) 329 + static inline void insb(u32 io_addr, u8 *vaddr, u32 count) 306 330 { 307 331 while (count--) 308 332 *vaddr++ = inb(io_addr); 309 333 } 310 334 311 - static inline u16 312 - __ixp4xx_inw(u32 addr) 335 + static inline u16 inw(u32 addr) 313 336 { 314 337 u32 n, byte_enables, data; 315 338 n = addr % 4; ··· 318 345 return data>>(8*n); 319 346 } 320 347 321 - static inline void 322 - __ixp4xx_insw(u32 io_addr, u16 *vaddr, u32 count) 348 + static inline void insw(u32 io_addr, u16 *vaddr, u32 count) 323 349 { 324 350 while (count--) 325 351 *vaddr++ = le16_to_cpu(inw(io_addr)); 326 352 } 327 353 328 - static inline u32 329 - __ixp4xx_inl(u32 addr) 354 + static inline u32 inl(u32 addr) 330 355 { 331 356 u32 data; 332 357 if (ixp4xx_pci_read(addr, NP_CMD_IOREAD, &data)) ··· 333 362 return data; 334 363 } 335 364 336 - static inline void 337 - __ixp4xx_insl(u32 io_addr, u32 *vaddr, u32 count) 365 + static inline void insl(u32 io_addr, u32 *vaddr, u32 count) 338 366 { 339 367 while (count--) 340 - *vaddr++ = inl(io_addr); 368 + *vaddr++ = le32_to_cpu(inl(io_addr)); 341 369 } 342 370 343 371 #define PIO_OFFSET 0x10000UL ··· 344 374 345 375 #define __is_io_address(p) (((unsigned long)p >= PIO_OFFSET) && \ 346 376 ((unsigned long)p <= (PIO_MASK + PIO_OFFSET))) 347 - static inline unsigned int 348 - __ixp4xx_ioread8(const void __iomem *addr) 377 + 378 + #define ioread8(p) ioread8(p) 379 + static inline unsigned int ioread8(const void __iomem *addr) 349 380 { 350 381 unsigned long port = (unsigned long __force)addr; 351 382 if (__is_io_address(port)) 352 - return (unsigned int)__ixp4xx_inb(port & PIO_MASK); 383 + return (unsigned int)inb(port & PIO_MASK); 353 384 else 354 385 #ifndef CONFIG_IXP4XX_INDIRECT_PCI 355 386 return (unsigned int)__raw_readb(port); 356 387 #else 357 - return (unsigned int)__ixp4xx_readb(addr); 388 + return (unsigned int)__indirect_readb(addr); 358 389 #endif 359 390 } 360 391 361 - static inline void 362 - __ixp4xx_ioread8_rep(const void __iomem *addr, void *vaddr, u32 count) 392 + #define ioread8_rep(p, v, c) ioread8_rep(p, v, c) 393 + static inline void ioread8_rep(const void __iomem *addr, void *vaddr, u32 count) 363 394 { 364 395 unsigned long port = (unsigned long __force)addr; 365 396 if (__is_io_address(port)) 366 - __ixp4xx_insb(port & PIO_MASK, vaddr, count); 397 + insb(port & PIO_MASK, vaddr, count); 367 398 else 368 399 #ifndef CONFIG_IXP4XX_INDIRECT_PCI 369 400 __raw_readsb(addr, vaddr, count); 370 401 #else 371 - __ixp4xx_readsb(addr, vaddr, count); 402 + __indirect_readsb(addr, vaddr, count); 372 403 #endif 373 404 } 374 405 375 - static inline unsigned int 376 - __ixp4xx_ioread16(const void __iomem *addr) 406 + #define ioread16(p) ioread16(p) 407 + static inline unsigned int ioread16(const void __iomem *addr) 377 408 { 378 409 unsigned long port = (unsigned long __force)addr; 379 410 if (__is_io_address(port)) 380 - return (unsigned int)__ixp4xx_inw(port & PIO_MASK); 411 + return (unsigned int)inw(port & PIO_MASK); 381 412 else 382 413 #ifndef CONFIG_IXP4XX_INDIRECT_PCI 383 414 return le16_to_cpu(__raw_readw((u32)port)); 384 415 #else 385 - return (unsigned int)__ixp4xx_readw(addr); 416 + return (unsigned int)__indirect_readw(addr); 386 417 #endif 387 418 } 388 419 389 - static inline void 390 - __ixp4xx_ioread16_rep(const void __iomem *addr, void *vaddr, u32 count) 420 + #define ioread16_rep(p, v, c) ioread16_rep(p, v, c) 421 + static inline void ioread16_rep(const void __iomem *addr, void *vaddr, 422 + u32 count) 391 423 { 392 424 unsigned long port = (unsigned long __force)addr; 393 425 if (__is_io_address(port)) 394 - __ixp4xx_insw(port & PIO_MASK, vaddr, count); 426 + insw(port & PIO_MASK, vaddr, count); 395 427 else 396 428 #ifndef CONFIG_IXP4XX_INDIRECT_PCI 397 429 __raw_readsw(addr, vaddr, count); 398 430 #else 399 - __ixp4xx_readsw(addr, vaddr, count); 431 + __indirect_readsw(addr, vaddr, count); 400 432 #endif 401 433 } 402 434 403 - static inline unsigned int 404 - __ixp4xx_ioread32(const void __iomem *addr) 435 + #define ioread32(p) ioread32(p) 436 + static inline unsigned int ioread32(const void __iomem *addr) 405 437 { 406 438 unsigned long port = (unsigned long __force)addr; 407 439 if (__is_io_address(port)) 408 - return (unsigned int)__ixp4xx_inl(port & PIO_MASK); 440 + return (unsigned int)inl(port & PIO_MASK); 409 441 else { 410 442 #ifndef CONFIG_IXP4XX_INDIRECT_PCI 411 443 return le32_to_cpu((__force __le32)__raw_readl(addr)); 412 444 #else 413 - return (unsigned int)__ixp4xx_readl(addr); 445 + return (unsigned int)__indirect_readl(addr); 414 446 #endif 415 447 } 416 448 } 417 449 418 - static inline void 419 - __ixp4xx_ioread32_rep(const void __iomem *addr, void *vaddr, u32 count) 450 + #define ioread32_rep(p, v, c) ioread32_rep(p, v, c) 451 + static inline void ioread32_rep(const void __iomem *addr, void *vaddr, 452 + u32 count) 420 453 { 421 454 unsigned long port = (unsigned long __force)addr; 422 455 if (__is_io_address(port)) 423 - __ixp4xx_insl(port & PIO_MASK, vaddr, count); 456 + insl(port & PIO_MASK, vaddr, count); 424 457 else 425 458 #ifndef CONFIG_IXP4XX_INDIRECT_PCI 426 459 __raw_readsl(addr, vaddr, count); 427 460 #else 428 - __ixp4xx_readsl(addr, vaddr, count); 461 + __indirect_readsl(addr, vaddr, count); 429 462 #endif 430 463 } 431 464 432 - static inline void 433 - __ixp4xx_iowrite8(u8 value, void __iomem *addr) 465 + #define iowrite8(v, p) iowrite8(v, p) 466 + static inline void iowrite8(u8 value, void __iomem *addr) 434 467 { 435 468 unsigned long port = (unsigned long __force)addr; 436 469 if (__is_io_address(port)) 437 - __ixp4xx_outb(value, port & PIO_MASK); 470 + outb(value, port & PIO_MASK); 438 471 else 439 472 #ifndef CONFIG_IXP4XX_INDIRECT_PCI 440 473 __raw_writeb(value, port); 441 474 #else 442 - __ixp4xx_writeb(value, addr); 475 + __indirect_writeb(value, addr); 443 476 #endif 444 477 } 445 478 446 - static inline void 447 - __ixp4xx_iowrite8_rep(void __iomem *addr, const void *vaddr, u32 count) 479 + #define iowrite8_rep(p, v, c) iowrite8_rep(p, v, c) 480 + static inline void iowrite8_rep(void __iomem *addr, const void *vaddr, 481 + u32 count) 448 482 { 449 483 unsigned long port = (unsigned long __force)addr; 450 484 if (__is_io_address(port)) 451 - __ixp4xx_outsb(port & PIO_MASK, vaddr, count); 485 + outsb(port & PIO_MASK, vaddr, count); 452 486 else 453 487 #ifndef CONFIG_IXP4XX_INDIRECT_PCI 454 488 __raw_writesb(addr, vaddr, count); 455 489 #else 456 - __ixp4xx_writesb(addr, vaddr, count); 490 + __indirect_writesb(addr, vaddr, count); 457 491 #endif 458 492 } 459 493 460 - static inline void 461 - __ixp4xx_iowrite16(u16 value, void __iomem *addr) 494 + #define iowrite16(v, p) iowrite16(v, p) 495 + static inline void iowrite16(u16 value, void __iomem *addr) 462 496 { 463 497 unsigned long port = (unsigned long __force)addr; 464 498 if (__is_io_address(port)) 465 - __ixp4xx_outw(value, port & PIO_MASK); 499 + outw(value, port & PIO_MASK); 466 500 else 467 501 #ifndef CONFIG_IXP4XX_INDIRECT_PCI 468 502 __raw_writew(cpu_to_le16(value), addr); 469 503 #else 470 - __ixp4xx_writew(value, addr); 504 + __indirect_writew(value, addr); 471 505 #endif 472 506 } 473 507 474 - static inline void 475 - __ixp4xx_iowrite16_rep(void __iomem *addr, const void *vaddr, u32 count) 508 + #define iowrite16_rep(p, v, c) iowrite16_rep(p, v, c) 509 + static inline void iowrite16_rep(void __iomem *addr, const void *vaddr, 510 + u32 count) 476 511 { 477 512 unsigned long port = (unsigned long __force)addr; 478 513 if (__is_io_address(port)) 479 - __ixp4xx_outsw(port & PIO_MASK, vaddr, count); 514 + outsw(port & PIO_MASK, vaddr, count); 480 515 else 481 516 #ifndef CONFIG_IXP4XX_INDIRECT_PCI 482 517 __raw_writesw(addr, vaddr, count); 483 518 #else 484 - __ixp4xx_writesw(addr, vaddr, count); 519 + __indirect_writesw(addr, vaddr, count); 485 520 #endif 486 521 } 487 522 488 - static inline void 489 - __ixp4xx_iowrite32(u32 value, void __iomem *addr) 523 + #define iowrite32(v, p) iowrite32(v, p) 524 + static inline void iowrite32(u32 value, void __iomem *addr) 490 525 { 491 526 unsigned long port = (unsigned long __force)addr; 492 527 if (__is_io_address(port)) 493 - __ixp4xx_outl(value, port & PIO_MASK); 528 + outl(value, port & PIO_MASK); 494 529 else 495 530 #ifndef CONFIG_IXP4XX_INDIRECT_PCI 496 531 __raw_writel((u32 __force)cpu_to_le32(value), addr); 497 532 #else 498 - __ixp4xx_writel(value, addr); 533 + __indirect_writel(value, addr); 499 534 #endif 500 535 } 501 536 502 - static inline void 503 - __ixp4xx_iowrite32_rep(void __iomem *addr, const void *vaddr, u32 count) 537 + #define iowrite32_rep(p, v, c) iowrite32_rep(p, v, c) 538 + static inline void iowrite32_rep(void __iomem *addr, const void *vaddr, 539 + u32 count) 504 540 { 505 541 unsigned long port = (unsigned long __force)addr; 506 542 if (__is_io_address(port)) 507 - __ixp4xx_outsl(port & PIO_MASK, vaddr, count); 543 + outsl(port & PIO_MASK, vaddr, count); 508 544 else 509 545 #ifndef CONFIG_IXP4XX_INDIRECT_PCI 510 546 __raw_writesl(addr, vaddr, count); 511 547 #else 512 - __ixp4xx_writesl(addr, vaddr, count); 548 + __indirect_writesl(addr, vaddr, count); 513 549 #endif 514 550 } 515 551 516 - #define ioread8(p) __ixp4xx_ioread8(p) 517 - #define ioread16(p) __ixp4xx_ioread16(p) 518 - #define ioread32(p) __ixp4xx_ioread32(p) 519 - 520 - #define ioread8_rep(p, v, c) __ixp4xx_ioread8_rep(p, v, c) 521 - #define ioread16_rep(p, v, c) __ixp4xx_ioread16_rep(p, v, c) 522 - #define ioread32_rep(p, v, c) __ixp4xx_ioread32_rep(p, v, c) 523 - 524 - #define iowrite8(v,p) __ixp4xx_iowrite8(v,p) 525 - #define iowrite16(v,p) __ixp4xx_iowrite16(v,p) 526 - #define iowrite32(v,p) __ixp4xx_iowrite32(v,p) 527 - 528 - #define iowrite8_rep(p, v, c) __ixp4xx_iowrite8_rep(p, v, c) 529 - #define iowrite16_rep(p, v, c) __ixp4xx_iowrite16_rep(p, v, c) 530 - #define iowrite32_rep(p, v, c) __ixp4xx_iowrite32_rep(p, v, c) 531 - 532 552 #define ioport_map(port, nr) ((void __iomem*)(port + PIO_OFFSET)) 533 553 #define ioport_unmap(addr) 534 - #endif // !CONFIG_PCI 554 + #endif /* CONFIG_PCI */ 535 555 536 - #endif // __ASM_ARM_ARCH_IO_H 537 - 556 + #endif /* __ASM_ARM_ARCH_IO_H */
+3 -66
arch/arm/mach-ixp4xx/include/mach/irqs.h
··· 15 15 #ifndef _ARCH_IXP4XX_IRQS_H_ 16 16 #define _ARCH_IXP4XX_IRQS_H_ 17 17 18 - 19 18 #define IRQ_IXP4XX_NPEA 0 20 19 #define IRQ_IXP4XX_NPEB 1 21 20 #define IRQ_IXP4XX_NPEC 2 ··· 58 59 #define IRQ_IXP4XX_MCU_ECC 61 59 60 #define IRQ_IXP4XX_EXP_PE 62 60 61 62 + #define _IXP4XX_GPIO_IRQ(n) (IRQ_IXP4XX_GPIO ## n) 63 + #define IXP4XX_GPIO_IRQ(n) _IXP4XX_GPIO_IRQ(n) 64 + 61 65 /* 62 66 * Only first 32 sources are valid if running on IXP42x systems 63 67 */ ··· 71 69 #endif 72 70 73 71 #define XSCALE_PMU_IRQ (IRQ_IXP4XX_XSCALE_PMU) 74 - 75 - /* 76 - * IXDP425 board IRQs 77 - */ 78 - #define IRQ_IXDP425_PCI_INTA IRQ_IXP4XX_GPIO11 79 - #define IRQ_IXDP425_PCI_INTB IRQ_IXP4XX_GPIO10 80 - #define IRQ_IXDP425_PCI_INTC IRQ_IXP4XX_GPIO9 81 - #define IRQ_IXDP425_PCI_INTD IRQ_IXP4XX_GPIO8 82 - 83 - /* 84 - * Gateworks Avila board IRQs 85 - */ 86 - #define IRQ_AVILA_PCI_INTA IRQ_IXP4XX_GPIO11 87 - #define IRQ_AVILA_PCI_INTB IRQ_IXP4XX_GPIO10 88 - #define IRQ_AVILA_PCI_INTC IRQ_IXP4XX_GPIO9 89 - #define IRQ_AVILA_PCI_INTD IRQ_IXP4XX_GPIO8 90 - 91 - 92 - /* 93 - * PrPMC1100 Board IRQs 94 - */ 95 - #define IRQ_PRPMC1100_PCI_INTA IRQ_IXP4XX_GPIO11 96 - #define IRQ_PRPMC1100_PCI_INTB IRQ_IXP4XX_GPIO10 97 - #define IRQ_PRPMC1100_PCI_INTC IRQ_IXP4XX_GPIO9 98 - #define IRQ_PRPMC1100_PCI_INTD IRQ_IXP4XX_GPIO8 99 - 100 - /* 101 - * ADI Coyote Board IRQs 102 - */ 103 - #define IRQ_COYOTE_PCI_SLOT0 IRQ_IXP4XX_GPIO6 104 - #define IRQ_COYOTE_PCI_SLOT1 IRQ_IXP4XX_GPIO11 105 - #define IRQ_COYOTE_IDE IRQ_IXP4XX_GPIO5 106 - 107 - /* 108 - * NSLU2 board IRQs 109 - */ 110 - #define IRQ_NSLU2_PCI_INTA IRQ_IXP4XX_GPIO11 111 - #define IRQ_NSLU2_PCI_INTB IRQ_IXP4XX_GPIO10 112 - #define IRQ_NSLU2_PCI_INTC IRQ_IXP4XX_GPIO9 113 - 114 - /* 115 - * NAS100D board IRQs 116 - */ 117 - #define IRQ_NAS100D_PCI_INTA IRQ_IXP4XX_GPIO11 118 - #define IRQ_NAS100D_PCI_INTB IRQ_IXP4XX_GPIO10 119 - #define IRQ_NAS100D_PCI_INTC IRQ_IXP4XX_GPIO9 120 - #define IRQ_NAS100D_PCI_INTD IRQ_IXP4XX_GPIO8 121 - #define IRQ_NAS100D_PCI_INTE IRQ_IXP4XX_GPIO7 122 - 123 - /* 124 - * D-Link DSM-G600 RevA board IRQs 125 - */ 126 - #define IRQ_DSMG600_PCI_INTA IRQ_IXP4XX_GPIO11 127 - #define IRQ_DSMG600_PCI_INTB IRQ_IXP4XX_GPIO10 128 - #define IRQ_DSMG600_PCI_INTC IRQ_IXP4XX_GPIO9 129 - #define IRQ_DSMG600_PCI_INTD IRQ_IXP4XX_GPIO8 130 - #define IRQ_DSMG600_PCI_INTE IRQ_IXP4XX_GPIO7 131 - #define IRQ_DSMG600_PCI_INTF IRQ_IXP4XX_GPIO6 132 - 133 - /* 134 - * Freecom FSG-3 Board IRQs 135 - */ 136 - #define IRQ_FSG_PCI_INTA IRQ_IXP4XX_GPIO6 137 - #define IRQ_FSG_PCI_INTB IRQ_IXP4XX_GPIO7 138 - #define IRQ_FSG_PCI_INTC IRQ_IXP4XX_GPIO5 139 72 140 73 #endif
-39
arch/arm/mach-ixp4xx/include/mach/ixdp425.h
··· 1 - /* 2 - * arch/arm/mach-ixp4xx/include/mach/ixdp425.h 3 - * 4 - * IXDP425 platform specific definitions 5 - * 6 - * Author: Deepak Saxena <dsaxena@plexity.net> 7 - * 8 - * Copyright 2004 (c) MontaVista, Software, Inc. 9 - * 10 - * This file is licensed under the terms of the GNU General Public 11 - * License version 2. This program is licensed "as is" without any 12 - * warranty of any kind, whether express or implied. 13 - */ 14 - 15 - #ifndef __ASM_ARCH_HARDWARE_H__ 16 - #error "Do not include this directly, instead #include <mach/hardware.h>" 17 - #endif 18 - 19 - #define IXDP425_SDA_PIN 7 20 - #define IXDP425_SCL_PIN 6 21 - 22 - /* 23 - * IXDP425 PCI IRQs 24 - */ 25 - #define IXDP425_PCI_MAX_DEV 4 26 - #define IXDP425_PCI_IRQ_LINES 4 27 - 28 - 29 - /* PCI controller GPIO to IRQ pin mappings */ 30 - #define IXDP425_PCI_INTA_PIN 11 31 - #define IXDP425_PCI_INTB_PIN 10 32 - #define IXDP425_PCI_INTC_PIN 9 33 - #define IXDP425_PCI_INTD_PIN 8 34 - 35 - /* NAND Flash pins */ 36 - #define IXDP425_NAND_NCE_PIN 12 37 - 38 - #define IXDP425_NAND_CMD_BYTE 0x01 39 - #define IXDP425_NAND_ADDR_BYTE 0x02
-52
arch/arm/mach-ixp4xx/include/mach/nas100d.h
··· 1 - /* 2 - * arch/arm/mach-ixp4xx/include/mach/nas100d.h 3 - * 4 - * NAS100D platform specific definitions 5 - * 6 - * Copyright (c) 2005 Tower Technologies 7 - * 8 - * Author: Alessandro Zummo <a.zummo@towertech.it> 9 - * 10 - * based on ixdp425.h: 11 - * Copyright 2004 (c) MontaVista, Software, Inc. 12 - * 13 - * This file is licensed under the terms of the GNU General Public 14 - * License version 2. This program is licensed "as is" without any 15 - * warranty of any kind, whether express or implied. 16 - */ 17 - 18 - #ifndef __ASM_ARCH_HARDWARE_H__ 19 - #error "Do not include this directly, instead #include <mach/hardware.h>" 20 - #endif 21 - 22 - #define NAS100D_SDA_PIN 5 23 - #define NAS100D_SCL_PIN 6 24 - 25 - /* 26 - * NAS100D PCI IRQs 27 - */ 28 - #define NAS100D_PCI_MAX_DEV 3 29 - #define NAS100D_PCI_IRQ_LINES 3 30 - 31 - 32 - /* PCI controller GPIO to IRQ pin mappings */ 33 - #define NAS100D_PCI_INTA_PIN 11 34 - #define NAS100D_PCI_INTB_PIN 10 35 - #define NAS100D_PCI_INTC_PIN 9 36 - #define NAS100D_PCI_INTD_PIN 8 37 - #define NAS100D_PCI_INTE_PIN 7 38 - 39 - /* Buttons */ 40 - 41 - #define NAS100D_PB_GPIO 14 /* power button */ 42 - #define NAS100D_RB_GPIO 4 /* reset button */ 43 - 44 - /* Power control */ 45 - 46 - #define NAS100D_PO_GPIO 12 /* power off */ 47 - 48 - /* LEDs */ 49 - 50 - #define NAS100D_LED_WLAN_GPIO 0 51 - #define NAS100D_LED_DISK_GPIO 3 52 - #define NAS100D_LED_PWR_GPIO 15
+1 -1
arch/arm/mach-ixp4xx/include/mach/npe.h
··· 33 33 int npe_recv_message(struct npe *npe, void *msg, const char *what); 34 34 int npe_send_recv_message(struct npe *npe, void *msg, const char *what); 35 35 int npe_load_firmware(struct npe *npe, const char *name, struct device *dev); 36 - struct npe *npe_request(int id); 36 + struct npe *npe_request(unsigned id); 37 37 void npe_release(struct npe *npe); 38 38 39 39 #endif /* __IXP4XX_NPE_H */
-55
arch/arm/mach-ixp4xx/include/mach/nslu2.h
··· 1 - /* 2 - * arch/arm/mach-ixp4xx/include/mach/nslu2.h 3 - * 4 - * NSLU2 platform specific definitions 5 - * 6 - * Author: Mark Rakes <mrakes AT mac.com> 7 - * Maintainers: http://www.nslu2-linux.org 8 - * 9 - * based on ixdp425.h: 10 - * Copyright 2004 (c) MontaVista, Software, Inc. 11 - * 12 - * This file is licensed under the terms of the GNU General Public 13 - * License version 2. This program is licensed "as is" without any 14 - * warranty of any kind, whether express or implied. 15 - */ 16 - 17 - #ifndef __ASM_ARCH_HARDWARE_H__ 18 - #error "Do not include this directly, instead #include <mach/hardware.h>" 19 - #endif 20 - 21 - #define NSLU2_SDA_PIN 7 22 - #define NSLU2_SCL_PIN 6 23 - 24 - /* 25 - * NSLU2 PCI IRQs 26 - */ 27 - #define NSLU2_PCI_MAX_DEV 3 28 - #define NSLU2_PCI_IRQ_LINES 3 29 - 30 - 31 - /* PCI controller GPIO to IRQ pin mappings */ 32 - #define NSLU2_PCI_INTA_PIN 11 33 - #define NSLU2_PCI_INTB_PIN 10 34 - #define NSLU2_PCI_INTC_PIN 9 35 - #define NSLU2_PCI_INTD_PIN 8 36 - 37 - /* NSLU2 Timer */ 38 - #define NSLU2_FREQ 66000000 39 - 40 - /* Buttons */ 41 - 42 - #define NSLU2_PB_GPIO 5 /* power button */ 43 - #define NSLU2_PO_GPIO 8 /* power off */ 44 - #define NSLU2_RB_GPIO 12 /* reset button */ 45 - 46 - /* Buzzer */ 47 - 48 - #define NSLU2_GPIO_BUZZ 4 49 - 50 - /* LEDs */ 51 - 52 - #define NSLU2_LED_RED_GPIO 0 53 - #define NSLU2_LED_GRN_GPIO 1 54 - #define NSLU2_LED_DISK1_GPIO 3 55 - #define NSLU2_LED_DISK2_GPIO 2
-33
arch/arm/mach-ixp4xx/include/mach/prpmc1100.h
··· 1 - /* 2 - * arch/arm/mach-ixp4xx/include/mach/prpmc1100.h 3 - * 4 - * Motorolla PrPMC1100 platform specific definitions 5 - * 6 - * Author: Deepak Saxena <dsaxena@plexity.net> 7 - * 8 - * Copyright 2004 (c) MontaVista, Software, Inc. 9 - * 10 - * This file is licensed under the terms of the GNU General Public 11 - * License version 2. This program is licensed "as is" without any 12 - * warranty of any kind, whether express or implied. 13 - */ 14 - 15 - #ifndef __ASM_ARCH_HARDWARE_H__ 16 - #error "Do not include this directly, instead #include <mach/hardware.h>" 17 - #endif 18 - 19 - #define PRPMC1100_FLASH_BASE IXP4XX_EXP_BUS_CS0_BASE_PHYS 20 - #define PRPMC1100_FLASH_SIZE IXP4XX_EXP_BUS_CSX_REGION_SIZE 21 - 22 - #define PRPMC1100_PCI_MIN_DEVID 10 23 - #define PRPMC1100_PCI_MAX_DEVID 16 24 - #define PRPMC1100_PCI_IRQ_LINES 4 25 - 26 - 27 - /* PCI controller GPIO to IRQ pin mappings */ 28 - #define PRPMC1100_PCI_INTA_PIN 11 29 - #define PRPMC1100_PCI_INTB_PIN 10 30 - #define PRPMC1100_PCI_INTC_PIN 9 31 - #define PRPMC1100_PCI_INTD_PIN 8 32 - 33 -
+1 -1
arch/arm/mach-ixp4xx/include/mach/timex.h
··· 10 10 * 66.66... MHz. We do a convulted calculation of CLOCK_TICK_RATE b/c the 11 11 * timer register ignores the bottom 2 bits of the LATCH value. 12 12 */ 13 - #define FREQ 66666666 13 + #define FREQ 66666000 14 14 #define CLOCK_TICK_RATE (((FREQ / HZ & ~IXP4XX_OST_RELOAD_MASK) + 1) * HZ) 15 15
+23 -20
arch/arm/mach-ixp4xx/ixdp425-pci.c
··· 1 1 /* 2 - * arch/arm/mach-ixp4xx/ixdp425-pci.c 2 + * arch/arm/mach-ixp4xx/ixdp425-pci.c 3 3 * 4 4 * IXDP425 board-level PCI initialization 5 5 * ··· 19 19 #include <linux/init.h> 20 20 #include <linux/irq.h> 21 21 #include <linux/delay.h> 22 - 23 22 #include <asm/mach/pci.h> 24 23 #include <asm/irq.h> 25 24 #include <mach/hardware.h> 26 25 #include <asm/mach-types.h> 27 26 27 + #define MAX_DEV 4 28 + #define IRQ_LINES 4 29 + 30 + /* PCI controller GPIO to IRQ pin mappings */ 31 + #define INTA 11 32 + #define INTB 10 33 + #define INTC 9 34 + #define INTD 8 35 + 36 + 28 37 void __init ixdp425_pci_preinit(void) 29 38 { 30 - set_irq_type(IRQ_IXDP425_PCI_INTA, IRQ_TYPE_LEVEL_LOW); 31 - set_irq_type(IRQ_IXDP425_PCI_INTB, IRQ_TYPE_LEVEL_LOW); 32 - set_irq_type(IRQ_IXDP425_PCI_INTC, IRQ_TYPE_LEVEL_LOW); 33 - set_irq_type(IRQ_IXDP425_PCI_INTD, IRQ_TYPE_LEVEL_LOW); 34 - 39 + set_irq_type(IXP4XX_GPIO_IRQ(INTA), IRQ_TYPE_LEVEL_LOW); 40 + set_irq_type(IXP4XX_GPIO_IRQ(INTB), IRQ_TYPE_LEVEL_LOW); 41 + set_irq_type(IXP4XX_GPIO_IRQ(INTC), IRQ_TYPE_LEVEL_LOW); 42 + set_irq_type(IXP4XX_GPIO_IRQ(INTD), IRQ_TYPE_LEVEL_LOW); 35 43 ixp4xx_pci_preinit(); 36 44 } 37 45 38 46 static int __init ixdp425_map_irq(struct pci_dev *dev, u8 slot, u8 pin) 39 47 { 40 - static int pci_irq_table[IXDP425_PCI_IRQ_LINES] = { 41 - IRQ_IXDP425_PCI_INTA, 42 - IRQ_IXDP425_PCI_INTB, 43 - IRQ_IXDP425_PCI_INTC, 44 - IRQ_IXDP425_PCI_INTD 48 + static int pci_irq_table[IRQ_LINES] = { 49 + IXP4XX_GPIO_IRQ(INTA), 50 + IXP4XX_GPIO_IRQ(INTB), 51 + IXP4XX_GPIO_IRQ(INTC), 52 + IXP4XX_GPIO_IRQ(INTD) 45 53 }; 46 54 47 - int irq = -1; 55 + if (slot >= 1 && slot <= MAX_DEV && pin >= 1 && pin <= IRQ_LINES) 56 + return pci_irq_table[(slot + pin - 2) % 4]; 48 57 49 - if (slot >= 1 && slot <= IXDP425_PCI_MAX_DEV && 50 - pin >= 1 && pin <= IXDP425_PCI_IRQ_LINES) { 51 - irq = pci_irq_table[(slot + pin - 2) % 4]; 52 - } 53 - 54 - return irq; 58 + return -1; 55 59 } 56 60 57 61 struct hw_pci ixdp425_pci __initdata = { ··· 76 72 } 77 73 78 74 subsys_initcall(ixdp425_pci_init); 79 -
+10 -2
arch/arm/mach-ixp4xx/ixdp425-setup.c
··· 1 1 /* 2 2 * arch/arm/mach-ixp4xx/ixdp425-setup.c 3 3 * 4 - * IXDP425/IXCDP1100 board-setup 4 + * IXDP425/IXCDP1100 board-setup 5 5 * 6 6 * Copyright (C) 2003-2005 MontaVista Software, Inc. 7 7 * ··· 21 21 #include <linux/mtd/nand.h> 22 22 #include <linux/mtd/partitions.h> 23 23 #include <linux/delay.h> 24 - 25 24 #include <asm/types.h> 26 25 #include <asm/setup.h> 27 26 #include <asm/memory.h> ··· 29 30 #include <asm/irq.h> 30 31 #include <asm/mach/arch.h> 31 32 #include <asm/mach/flash.h> 33 + 34 + #define IXDP425_SDA_PIN 7 35 + #define IXDP425_SCL_PIN 6 36 + 37 + /* NAND Flash pins */ 38 + #define IXDP425_NAND_NCE_PIN 12 39 + 40 + #define IXDP425_NAND_CMD_BYTE 0x01 41 + #define IXDP425_NAND_ADDR_BYTE 0x02 32 42 33 43 static struct flash_platform_data ixdp425_flash_data = { 34 44 .map_name = "cfi_probe",
+1 -1
arch/arm/mach-ixp4xx/ixp4xx_npe.c
··· 665 665 } 666 666 667 667 668 - struct npe *npe_request(int id) 668 + struct npe *npe_request(unsigned id) 669 669 { 670 670 if (id < NPE_COUNT) 671 671 if (npe_tab[id].valid)
+23 -18
arch/arm/mach-ixp4xx/nas100d-pci.c
··· 18 18 #include <linux/pci.h> 19 19 #include <linux/init.h> 20 20 #include <linux/irq.h> 21 - 22 21 #include <asm/mach/pci.h> 23 22 #include <asm/mach-types.h> 24 23 24 + #define MAX_DEV 3 25 + #define IRQ_LINES 3 26 + 27 + /* PCI controller GPIO to IRQ pin mappings */ 28 + #define INTA 11 29 + #define INTB 10 30 + #define INTC 9 31 + #define INTD 8 32 + #define INTE 7 33 + 25 34 void __init nas100d_pci_preinit(void) 26 35 { 27 - set_irq_type(IRQ_NAS100D_PCI_INTA, IRQ_TYPE_LEVEL_LOW); 28 - set_irq_type(IRQ_NAS100D_PCI_INTB, IRQ_TYPE_LEVEL_LOW); 29 - set_irq_type(IRQ_NAS100D_PCI_INTC, IRQ_TYPE_LEVEL_LOW); 30 - set_irq_type(IRQ_NAS100D_PCI_INTD, IRQ_TYPE_LEVEL_LOW); 31 - set_irq_type(IRQ_NAS100D_PCI_INTE, IRQ_TYPE_LEVEL_LOW); 32 - 36 + set_irq_type(IXP4XX_GPIO_IRQ(INTA), IRQ_TYPE_LEVEL_LOW); 37 + set_irq_type(IXP4XX_GPIO_IRQ(INTB), IRQ_TYPE_LEVEL_LOW); 38 + set_irq_type(IXP4XX_GPIO_IRQ(INTC), IRQ_TYPE_LEVEL_LOW); 39 + set_irq_type(IXP4XX_GPIO_IRQ(INTD), IRQ_TYPE_LEVEL_LOW); 40 + set_irq_type(IXP4XX_GPIO_IRQ(INTE), IRQ_TYPE_LEVEL_LOW); 33 41 ixp4xx_pci_preinit(); 34 42 } 35 43 36 44 static int __init nas100d_map_irq(struct pci_dev *dev, u8 slot, u8 pin) 37 45 { 38 - static int pci_irq_table[NAS100D_PCI_MAX_DEV][NAS100D_PCI_IRQ_LINES] = 39 - { 40 - { IRQ_NAS100D_PCI_INTA, -1, -1 }, 41 - { IRQ_NAS100D_PCI_INTB, -1, -1 }, 42 - { IRQ_NAS100D_PCI_INTC, IRQ_NAS100D_PCI_INTD, IRQ_NAS100D_PCI_INTE }, 46 + static int pci_irq_table[MAX_DEV][IRQ_LINES] = { 47 + { IXP4XX_GPIO_IRQ(INTA), -1, -1 }, 48 + { IXP4XX_GPIO_IRQ(INTB), -1, -1 }, 49 + { IXP4XX_GPIO_IRQ(INTC), IXP4XX_GPIO_IRQ(INTD), 50 + IXP4XX_GPIO_IRQ(INTE) }, 43 51 }; 44 52 45 - int irq = -1; 53 + if (slot >= 1 && slot <= MAX_DEV && pin >= 1 && pin <= IRQ_LINES) 54 + return pci_irq_table[slot - 1][pin - 1]; 46 55 47 - if (slot >= 1 && slot <= NAS100D_PCI_MAX_DEV && 48 - pin >= 1 && pin <= NAS100D_PCI_IRQ_LINES) 49 - irq = pci_irq_table[slot-1][pin-1]; 50 - 51 - return irq; 56 + return -1; 52 57 } 53 58 54 59 struct hw_pci __initdata nas100d_pci = {
+15 -1
arch/arm/mach-ixp4xx/nas100d-setup.c
··· 29 29 #include <linux/i2c.h> 30 30 #include <linux/i2c-gpio.h> 31 31 #include <linux/io.h> 32 - 33 32 #include <asm/mach-types.h> 34 33 #include <asm/mach/arch.h> 35 34 #include <asm/mach/flash.h> 36 35 #include <asm/gpio.h> 36 + 37 + #define NAS100D_SDA_PIN 5 38 + #define NAS100D_SCL_PIN 6 39 + 40 + /* Buttons */ 41 + #define NAS100D_PB_GPIO 14 /* power button */ 42 + #define NAS100D_RB_GPIO 4 /* reset button */ 43 + 44 + /* Power control */ 45 + #define NAS100D_PO_GPIO 12 /* power off */ 46 + 47 + /* LEDs */ 48 + #define NAS100D_LED_WLAN_GPIO 0 49 + #define NAS100D_LED_DISK_GPIO 3 50 + #define NAS100D_LED_PWR_GPIO 15 37 51 38 52 static struct flash_platform_data nas100d_flash_data = { 39 53 .map_name = "cfi_probe",
+19 -16
arch/arm/mach-ixp4xx/nslu2-pci.c
··· 18 18 #include <linux/pci.h> 19 19 #include <linux/init.h> 20 20 #include <linux/irq.h> 21 - 22 21 #include <asm/mach/pci.h> 23 22 #include <asm/mach-types.h> 24 23 24 + #define MAX_DEV 3 25 + #define IRQ_LINES 3 26 + 27 + /* PCI controller GPIO to IRQ pin mappings */ 28 + #define INTA 11 29 + #define INTB 10 30 + #define INTC 9 31 + #define INTD 8 32 + 25 33 void __init nslu2_pci_preinit(void) 26 34 { 27 - set_irq_type(IRQ_NSLU2_PCI_INTA, IRQ_TYPE_LEVEL_LOW); 28 - set_irq_type(IRQ_NSLU2_PCI_INTB, IRQ_TYPE_LEVEL_LOW); 29 - set_irq_type(IRQ_NSLU2_PCI_INTC, IRQ_TYPE_LEVEL_LOW); 30 - 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); 31 38 ixp4xx_pci_preinit(); 32 39 } 33 40 34 41 static int __init nslu2_map_irq(struct pci_dev *dev, u8 slot, u8 pin) 35 42 { 36 - static int pci_irq_table[NSLU2_PCI_IRQ_LINES] = { 37 - IRQ_NSLU2_PCI_INTA, 38 - IRQ_NSLU2_PCI_INTB, 39 - IRQ_NSLU2_PCI_INTC, 43 + static int pci_irq_table[IRQ_LINES] = { 44 + IXP4XX_GPIO_IRQ(INTA), 45 + IXP4XX_GPIO_IRQ(INTB), 46 + IXP4XX_GPIO_IRQ(INTC), 40 47 }; 41 48 42 - int irq = -1; 49 + if (slot >= 1 && slot <= MAX_DEV && pin >= 1 && pin <= IRQ_LINES) 50 + return pci_irq_table[(slot + pin - 2) % IRQ_LINES]; 43 51 44 - if (slot >= 1 && slot <= NSLU2_PCI_MAX_DEV && 45 - pin >= 1 && pin <= NSLU2_PCI_IRQ_LINES) { 46 - irq = pci_irq_table[(slot + pin - 2) % NSLU2_PCI_IRQ_LINES]; 47 - } 48 - 49 - return irq; 52 + return -1; 50 53 } 51 54 52 55 struct hw_pci __initdata nslu2_pci = {
+20 -1
arch/arm/mach-ixp4xx/nslu2-setup.c
··· 26 26 #include <linux/i2c.h> 27 27 #include <linux/i2c-gpio.h> 28 28 #include <linux/io.h> 29 - 30 29 #include <asm/mach-types.h> 31 30 #include <asm/mach/arch.h> 32 31 #include <asm/mach/flash.h> 33 32 #include <asm/mach/time.h> 34 33 #include <asm/gpio.h> 34 + 35 + #define NSLU2_SDA_PIN 7 36 + #define NSLU2_SCL_PIN 6 37 + 38 + /* NSLU2 Timer */ 39 + #define NSLU2_FREQ 66000000 40 + 41 + /* Buttons */ 42 + #define NSLU2_PB_GPIO 5 /* power button */ 43 + #define NSLU2_PO_GPIO 8 /* power off */ 44 + #define NSLU2_RB_GPIO 12 /* reset button */ 45 + 46 + /* Buzzer */ 47 + #define NSLU2_GPIO_BUZZ 4 48 + 49 + /* LEDs */ 50 + #define NSLU2_LED_RED_GPIO 0 51 + #define NSLU2_LED_GRN_GPIO 1 52 + #define NSLU2_LED_DISK1_GPIO 3 53 + #define NSLU2_LED_DISK2_GPIO 2 35 54 36 55 static struct flash_platform_data nslu2_flash_data = { 37 56 .map_name = "cfi_probe",
+7
drivers/leds/leds-fsg.c
··· 22 22 #include <mach/hardware.h> 23 23 #include <asm/io.h> 24 24 25 + #define FSG_LED_WLAN_BIT 0 26 + #define FSG_LED_WAN_BIT 1 27 + #define FSG_LED_SATA_BIT 2 28 + #define FSG_LED_USB_BIT 4 29 + #define FSG_LED_RING_BIT 5 30 + #define FSG_LED_SYNC_BIT 7 31 + 25 32 static short __iomem *latch_address; 26 33 static unsigned short latch_value; 27 34
+1 -1
drivers/net/arm/ixp4xx_eth.c
··· 322 322 ret = ixp4xx_mdio_cmd(bus, phy_id, location, 1, val); 323 323 spin_unlock_irqrestore(&mdio_lock, flags); 324 324 #if DEBUG_MDIO 325 - printk(KERN_DEBUG "%s #%i: MII read [%i] <- 0x%X, err = %i\n", 325 + printk(KERN_DEBUG "%s #%i: MII write [%i] <- 0x%X, err = %i\n", 326 326 bus->name, phy_id, location, val, ret); 327 327 #endif 328 328 return ret;