Ejemplo n.º 1
0
void baboon_irq_enable(int irq)
{
	int irq_idx = IRQ_IDX(irq);

#ifdef DEBUG_IRQUSE
	printk("baboon_irq_enable(%d)\n", irq);
#endif

	baboon_disabled &= ~(1 << irq_idx);
	if (!baboon_disabled)
		mac_enable_irq(IRQ_NUBUS_C);
}
Ejemplo n.º 2
0
static void mac_scsi_reset_boot(struct Scsi_Host *instance)
{
	unsigned long end;

	NCR5380_local_declare();
	NCR5380_setup(instance);
	
	/*
	 * Do a SCSI reset to clean up the bus during initialization. No messing
	 * with the queues, interrupts, or locks necessary here.
	 */

	printk(KERN_INFO "Macintosh SCSI: resetting the SCSI bus..." );

	/* switch off SCSI IRQ - catch an interrupt without IRQ bit set else */
	mac_disable_irq(IRQ_MAC_SCSI);

	/* get in phase */
	NCR5380_write( TARGET_COMMAND_REG,
		      PHASE_SR_TO_TCR( NCR5380_read(STATUS_REG) ));

	/* assert RST */
	NCR5380_write( INITIATOR_COMMAND_REG, ICR_BASE | ICR_ASSERT_RST );
	/* The min. reset hold time is 25us, so 40us should be enough */
	udelay( 50 );
	/* reset RST and interrupt */
	NCR5380_write( INITIATOR_COMMAND_REG, ICR_BASE );
	NCR5380_read( RESET_PARITY_INTERRUPT_REG );

	for( end = jiffies + AFTER_RESET_DELAY; time_before(jiffies, end); )
		barrier();

	/* switch on SCSI IRQ again */
	mac_enable_irq(IRQ_MAC_SCSI);

	printk(KERN_INFO " done\n" );
}
Ejemplo n.º 3
0
int mac_request_irq(unsigned int irq,
		    irqreturn_t (*handler)(int, void *, struct pt_regs *),
		    unsigned long flags, const char *devname, void *dev_id)
{
	irq_node_t *node;

#ifdef DEBUG_MACINTS
	printk ("%s: irq %d requested for %s\n", __FUNCTION__, irq, devname);
#endif

	if (irq < VIA1_SOURCE_BASE) {
		return sys_request_irq(irq, handler, flags, devname, dev_id);
	}

	if (irq >= NUM_MAC_SOURCES) {
		printk ("%s: unknown irq %d requested by %s\n",
		        __FUNCTION__, irq, devname);
	}

	/* Get a node and stick it onto the right list */

	if (!(node = new_irq_node())) return -ENOMEM;

	node->handler	= handler;
	node->flags	= flags;
	node->dev_id	= dev_id;
	node->devname	= devname;
	node->next	= NULL;
	mac_insert_irq(&mac_irq_list[irq], node);

	/* Now enable the IRQ source */

	mac_enable_irq(irq);

	return 0;
}