linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Josh Boyer <jwboyer@linux.vnet.ibm.com>
To: David Gibson <david@gibson.dropbear.id.au>
Cc: linuxppc-dev@ozlabs.org, Paul Mackerras <paulus@samba.org>
Subject: Re: [PATCH 4/10] Add arch/powerpc driver for UIC, PPC4xx interrupt controller
Date: Fri, 23 Mar 2007 07:20:47 -0500	[thread overview]
Message-ID: <1174652447.3518.22.camel@zod.rchland.ibm.com> (raw)
In-Reply-To: <20070322092202.1299EDDF3E@ozlabs.org>

On Thu, 2007-03-22 at 20:22 +1100, David Gibson wrote:
> 
> Index: working-2.6/arch/powerpc/sysdev/uic.c
> ===================================================================

 <snip>

> +static struct uic * __init uic_init_one(struct device_node *node)
> +{
> +	struct uic *uic;
> +	const u32 *indexp, *dcrreg;
> +	int len;
> +
> +	BUG_ON(! device_is_compatible(node, "ibm,uic"));
> +
> +	uic = alloc_bootmem(sizeof(*uic));
> +	if (! uic)
> +		return NULL; /* FIXME: panic? */
> +
> +	memset(uic, 0, sizeof(*uic));
> +	uic->of_node = of_node_get(node);
> +	indexp = get_property(node, "cell-index", &len);
> +	if (!indexp || (len != sizeof(u32))) {
> +		printk(KERN_ERR "uic: Device node %s has missing or invalid "
> +		       "cell-index property\n", node->full_name);
> +		return NULL;
> +	}
> +	uic->index = *indexp;
> +
> +	dcrreg = get_property(node, "dcr-reg", &len);
> +	if (!dcrreg || (len != 2*sizeof(u32))) {
> +		printk(KERN_ERR "uic: Device node %s has missing or invalid "
> +		       "dcr-reg property\n", node->full_name);
> +		return NULL;
> +	}
> +	uic->dcrbase = *dcrreg;
> +
> +	uic->irqhost = irq_alloc_host(IRQ_HOST_MAP_LINEAR, NR_UIC_INTS,
> +				      &uic_host_ops, -1);
> +	if (! uic->irqhost) {
> +		of_node_put(node);
> +		return NULL; /* FIXME: panic? */
> +	}
> +
> +	uic->irqhost->host_data = uic;
> +
> +	/* Start with all interrupts disable and non-critical */
> +	mtdcr(uic->dcrbase + UIC_ER, 0);
> +	mtdcr(uic->dcrbase + UIC_CR, 0);

I think at this point we should also clear the interrupts in the SR
register as well.  When playing with the Bamboo port, I found that the
firmware leaves pending interrupts, which can lead to some not nice
results when the cascade bits are enabled.

josh

  parent reply	other threads:[~2007-03-23 12:21 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-22  6:06 [0/10] arch/powerpc Ebony support (draft 3) David Gibson
2007-03-22  6:10 ` [PATCH 1/10] Define FIXED_PORT flag for serial_core David Gibson
2007-03-22  9:22 ` [PATCH 6/10] Support for Ebony in arch/powerpc David Gibson
2007-03-22  9:22 ` [PATCH 3/10] Re-organize Kconfig code for 4xx " David Gibson
2007-03-22  9:22 ` [PATCH 2/10] Use resource_size_t for serial port IO addresses David Gibson
2007-03-22  9:22 ` [PATCH 4/10] Add arch/powerpc driver for UIC, PPC4xx interrupt controller David Gibson
2007-03-22  9:51   ` Domen Puncer
2007-03-23  3:28     ` David Gibson
2007-03-23 12:20   ` Josh Boyer [this message]
2007-03-22  9:22 ` [PATCH 7/10] Early serial debug support for PPC44x David Gibson
2007-03-22  9:22 ` [PATCH 5/10] Port 44x MMU definitions to ARCH=powerpc David Gibson
2007-03-23 14:09   ` Kumar Gala
2007-03-23 23:30     ` David Gibson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1174652447.3518.22.camel@zod.rchland.ibm.com \
    --to=jwboyer@linux.vnet.ibm.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).