static void ixdp2x00_irq_handler(unsigned int irq, struct irq_desc *desc)
{
        volatile u32 ex_interrupt = 0;
	static struct slowport_cfg old_cfg;
	int i;

	desc->irq_data.chip->irq_mask(&desc->irq_data);

#ifdef CONFIG_ARCH_IXDP2400
	if (machine_is_ixdp2400())
		ixp2000_acquire_slowport(&slowport_cpld_cfg, &old_cfg);
#endif
        ex_interrupt = *board_irq_stat & 0xff;
	if (machine_is_ixdp2400())
		ixp2000_release_slowport(&old_cfg);

	if(!ex_interrupt) {
		printk(KERN_ERR "Spurious IXDP2x00 CPLD interrupt!\n");
		return;
	}

	for(i = 0; i < board_irq_count; i++) {
		if(ex_interrupt & (1 << i))  {
			int cpld_irq = IXP2000_BOARD_IRQ(0) + i;
			generic_handle_irq(cpld_irq);
		}
	}

	desc->irq_data.chip->irq_unmask(&desc->irq_data);
}
Пример #2
0
int __init ixdp2400_pci_init(void)
{
	if (machine_is_ixdp2400())
		pci_common_init(&ixdp2400_pci);

	return 0;
}
Пример #3
0
void __init ixp2000_pci_init(void *sysdata)
{
	external_fault = ixp2000_pci_abort_handler;
	
	DBG("PCI: set upper mem io bits\n");
	*IXP2000_PCI_ADDR_EXT = 0x0;  

	if (npu_is_master()) {/* master NPU */
		pci_scan_bus(0, &ixp2000_ops, sysdata);
	} else { /* NPU is slave */

		/*
		 * NOTE TO HW DESIGNERS:
		 *
		 * Do NOT make boards like this which have slave devices that scan
		 * the bus and own devices. It is completely against the PCI spec
		 * as it is _NOT_ a peer to peer bus.
		 */
		if(machine_is_ixdp2400())
			pci_scan_bus(0, &ixp2000_ops, sysdata);
	}

	/* enable PCI INTB */
 	*(IXP2000_IRQ_ENABLE_SET) = (1<<15);
	*IXP2000_PCI_XSCALE_INT_ENABLE |= (1<<27) | (1<<26);

	DBG("ixp200_pci_init Done\n");
}
static int __init ixdp2400_i2c_init(void)
{
	if(machine_is_ixdp2400()) {
		int i = 0;

		/*
		 * GPIO2 needs to be high for SDA to work on this board
		 */
		gpio_line_set(IXDP2400_GPIO_HIGH, 1);
		gpio_line_config(IXDP2400_GPIO_HIGH, GPIO_OUT);

		ixdp2400_gpio.sda_gpio = IXDP2400_GPIO_SCL;
		ixdp2400_gpio.scl_gpio = IXDP2400_GPIO_SDA;

		gpio_line_config(ixdp2400_gpio.sda_gpio, GPIO_OUT);
		gpio_line_config(ixdp2400_gpio.scl_gpio, GPIO_OUT);

		gpio_line_set(ixdp2400_gpio.scl_gpio, 0);
		gpio_line_set(ixdp2400_gpio.sda_gpio, 0);

		gpio_line_config(ixdp2400_gpio.scl_gpio, GPIO_IN);

		for(i = 0; i < 10; i++);

		gpio_line_config(ixdp2400_gpio.sda_gpio, GPIO_IN);
	}

	if (i2c_bit_add_bus(&ixdp2400_i2c_adapter)) {
		printk("i2c-ixdp2400: I2C adapter registration failed\n");
		return -EIO;
	} else printk("i2c-ixdp2400: I2C bus initialized\n");

	return 0;
}
static void ixdp2x00_irq_unmask(struct irq_data *d)
{
	unsigned long dummy;
	static struct slowport_cfg old_cfg;

#ifdef CONFIG_ARCH_IXDP2400
	if (machine_is_ixdp2400())
		ixp2000_acquire_slowport(&slowport_cpld_cfg, &old_cfg);
#endif

	dummy = *board_irq_mask;
	dummy &=  ~IXP2000_BOARD_IRQ_MASK(d->irq);
	ixp2000_reg_wrb(board_irq_mask, dummy);

	if (machine_is_ixdp2400()) 
		ixp2000_release_slowport(&old_cfg);
}
static void ixdp2x00_irq_mask(struct irq_data *d)
{
	unsigned long dummy;
	static struct slowport_cfg old_cfg;

	/*
	 * This is ugly in common code but really don't know
	 * of a better way to handle it. :(
	 */
#ifdef CONFIG_ARCH_IXDP2400
	if (machine_is_ixdp2400())
		ixp2000_acquire_slowport(&slowport_cpld_cfg, &old_cfg);
#endif

	dummy = *board_irq_mask;
	dummy |=  IXP2000_BOARD_IRQ_MASK(d->irq);
	ixp2000_reg_wrb(board_irq_mask, dummy);

#ifdef CONFIG_ARCH_IXDP2400
	if (machine_is_ixdp2400())
		ixp2000_release_slowport(&old_cfg);
#endif
}