2019-05-27 14:55:02 +08:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2005-06-23 07:43:43 +08:00
|
|
|
/*
|
|
|
|
* External Interrupt Controller on Spider South Bridge
|
|
|
|
*
|
|
|
|
* (C) Copyright IBM Deutschland Entwicklung GmbH 2005
|
|
|
|
*
|
|
|
|
* Author: Arnd Bergmann <arndb@de.ibm.com>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <linux/interrupt.h>
|
|
|
|
#include <linux/irq.h>
|
2006-07-03 19:36:01 +08:00
|
|
|
#include <linux/ioport.h>
|
2020-06-09 12:32:38 +08:00
|
|
|
#include <linux/pgtable.h>
|
2020-06-09 12:32:42 +08:00
|
|
|
|
2005-06-23 07:43:43 +08:00
|
|
|
#include <asm/prom.h>
|
|
|
|
#include <asm/io.h>
|
|
|
|
|
2005-11-01 09:08:37 +08:00
|
|
|
#include "interrupt.h"
|
2005-06-23 07:43:43 +08:00
|
|
|
|
|
|
|
/* register layout taken from Spider spec, table 7.4-4 */
|
|
|
|
enum {
|
|
|
|
TIR_DEN = 0x004, /* Detection Enable Register */
|
|
|
|
TIR_MSK = 0x084, /* Mask Level Register */
|
|
|
|
TIR_EDC = 0x0c0, /* Edge Detection Clear Register */
|
|
|
|
TIR_PNDA = 0x100, /* Pending Register A */
|
|
|
|
TIR_PNDB = 0x104, /* Pending Register B */
|
|
|
|
TIR_CS = 0x144, /* Current Status Register */
|
|
|
|
TIR_LCSA = 0x150, /* Level Current Status Register A */
|
|
|
|
TIR_LCSB = 0x154, /* Level Current Status Register B */
|
|
|
|
TIR_LCSC = 0x158, /* Level Current Status Register C */
|
|
|
|
TIR_LCSD = 0x15c, /* Level Current Status Register D */
|
|
|
|
TIR_CFGA = 0x200, /* Setting Register A0 */
|
|
|
|
TIR_CFGB = 0x204, /* Setting Register B0 */
|
|
|
|
/* 0x208 ... 0x3ff Setting Register An/Bn */
|
|
|
|
TIR_PPNDA = 0x400, /* Packet Pending Register A */
|
|
|
|
TIR_PPNDB = 0x404, /* Packet Pending Register B */
|
|
|
|
TIR_PIERA = 0x408, /* Packet Output Error Register A */
|
|
|
|
TIR_PIERB = 0x40c, /* Packet Output Error Register B */
|
|
|
|
TIR_PIEN = 0x444, /* Packet Output Enable Register */
|
|
|
|
TIR_PIPND = 0x454, /* Packet Output Pending Register */
|
|
|
|
TIRDID = 0x484, /* Spider Device ID Register */
|
|
|
|
REISTIM = 0x500, /* Reissue Command Timeout Time Setting */
|
|
|
|
REISTIMEN = 0x504, /* Reissue Command Timeout Setting */
|
|
|
|
REISWAITEN = 0x508, /* Reissue Wait Control*/
|
|
|
|
};
|
|
|
|
|
2006-07-03 19:36:01 +08:00
|
|
|
#define SPIDER_CHIP_COUNT 4
|
|
|
|
#define SPIDER_SRC_COUNT 64
|
|
|
|
#define SPIDER_IRQ_INVALID 63
|
2005-06-23 07:43:43 +08:00
|
|
|
|
2006-07-03 19:36:01 +08:00
|
|
|
struct spider_pic {
|
2012-02-15 05:06:50 +08:00
|
|
|
struct irq_domain *host;
|
2006-07-03 19:36:01 +08:00
|
|
|
void __iomem *regs;
|
|
|
|
unsigned int node_id;
|
|
|
|
};
|
|
|
|
static struct spider_pic spider_pics[SPIDER_CHIP_COUNT];
|
2005-06-23 07:43:43 +08:00
|
|
|
|
2011-05-11 03:30:29 +08:00
|
|
|
static struct spider_pic *spider_irq_data_to_pic(struct irq_data *d)
|
2005-06-23 07:43:43 +08:00
|
|
|
{
|
2011-05-11 03:30:29 +08:00
|
|
|
return irq_data_get_irq_chip_data(d);
|
2005-06-23 07:43:43 +08:00
|
|
|
}
|
|
|
|
|
2006-07-03 19:36:01 +08:00
|
|
|
static void __iomem *spider_get_irq_config(struct spider_pic *pic,
|
|
|
|
unsigned int src)
|
2005-06-23 07:43:43 +08:00
|
|
|
{
|
2006-07-03 19:36:01 +08:00
|
|
|
return pic->regs + TIR_CFGA + 8 * src;
|
2005-06-23 07:43:43 +08:00
|
|
|
}
|
|
|
|
|
2011-03-07 21:59:28 +08:00
|
|
|
static void spider_unmask_irq(struct irq_data *d)
|
2005-06-23 07:43:43 +08:00
|
|
|
{
|
2011-05-11 03:30:29 +08:00
|
|
|
struct spider_pic *pic = spider_irq_data_to_pic(d);
|
2011-05-04 13:02:15 +08:00
|
|
|
void __iomem *cfg = spider_get_irq_config(pic, irqd_to_hwirq(d));
|
2005-06-23 07:43:43 +08:00
|
|
|
|
2006-07-03 19:36:01 +08:00
|
|
|
out_be32(cfg, in_be32(cfg) | 0x30000000u);
|
2005-06-23 07:43:43 +08:00
|
|
|
}
|
|
|
|
|
2011-03-07 21:59:28 +08:00
|
|
|
static void spider_mask_irq(struct irq_data *d)
|
2005-06-23 07:43:43 +08:00
|
|
|
{
|
2011-05-11 03:30:29 +08:00
|
|
|
struct spider_pic *pic = spider_irq_data_to_pic(d);
|
2011-05-04 13:02:15 +08:00
|
|
|
void __iomem *cfg = spider_get_irq_config(pic, irqd_to_hwirq(d));
|
2005-06-23 07:43:43 +08:00
|
|
|
|
|
|
|
out_be32(cfg, in_be32(cfg) & ~0x30000000u);
|
|
|
|
}
|
|
|
|
|
2011-03-07 21:59:28 +08:00
|
|
|
static void spider_ack_irq(struct irq_data *d)
|
2005-06-23 07:43:43 +08:00
|
|
|
{
|
2011-05-11 03:30:29 +08:00
|
|
|
struct spider_pic *pic = spider_irq_data_to_pic(d);
|
2011-05-04 13:02:15 +08:00
|
|
|
unsigned int src = irqd_to_hwirq(d);
|
2006-07-03 19:36:01 +08:00
|
|
|
|
|
|
|
/* Reset edge detection logic if necessary
|
2006-07-03 17:32:51 +08:00
|
|
|
*/
|
2011-03-25 23:04:41 +08:00
|
|
|
if (irqd_is_level_type(d))
|
2006-07-03 19:36:01 +08:00
|
|
|
return;
|
|
|
|
|
|
|
|
/* Only interrupts 47 to 50 can be set to edge */
|
|
|
|
if (src < 47 || src > 50)
|
|
|
|
return;
|
|
|
|
|
|
|
|
/* Perform the clear of the edge logic */
|
|
|
|
out_be32(pic->regs + TIR_EDC, 0x100 | (src & 0xf));
|
2005-06-23 07:43:43 +08:00
|
|
|
}
|
|
|
|
|
2011-03-07 21:59:28 +08:00
|
|
|
static int spider_set_irq_type(struct irq_data *d, unsigned int type)
|
2005-06-23 07:43:43 +08:00
|
|
|
{
|
[PATCH] powerpc: fix trigger handling in the new irq code
This patch slightly reworks the new irq code to fix a small design error. I
removed the passing of the trigger to the map() calls entirely, it was not a
good idea to have one call do two different things. It also fixes a couple of
corner cases.
Mapping a linux virtual irq to a physical irq now does only that. Setting the
trigger is a different action which has a different call.
The main changes are:
- I no longer call host->ops->map() for an already mapped irq, I just return
the virtual number that was already mapped. It was called before to give an
opportunity to change the trigger, but that was causing issues as that could
happen while the interrupt was in use by a device, and because of the
trigger change, map would potentially muck around with things in a racy way.
That was causing much burden on a given's controller implementation of
map() to get it right. This is much simpler now. map() is only called on
the initial mapping of an irq, meaning that you know that this irq is _not_
being used. You can initialize the hardware if you want (though you don't
have to).
- Controllers that can handle different type of triggers (level/edge/etc...)
now implement the standard irq_chip->set_type() call as defined by the
generic code. That means that you can use the standard set_irq_type() to
configure an irq line manually if you wish or (though I don't like that
interface), pass explicit trigger flags to request_irq() as defined by the
generic kernel interfaces. Also, using those interfaces guarantees that
your controller set_type callback is called with the descriptor lock held,
thus providing locking against activity on the same interrupt (including
mask/unmask/etc...) automatically. A result is that, for example, MPIC's
own map() implementation calls irq_set_type(NONE) to configure the hardware
to the default triggers.
- To allow the above, the irq_map array entry for the new mapped interrupt
is now set before map() callback is called for the controller.
- The irq_create_of_mapping() (also used by irq_of_parse_and_map()) function
for mapping interrupts from the device-tree now also call the separate
set_irq_type(), and only does so if there is a change in the trigger type.
- While I was at it, I changed pci_read_irq_line() (which is the helper I
would expect most archs to use in their pcibios_fixup() to get the PCI
interrupt routing from the device tree) to also handle a fallback when the
DT mapping fails consisting of reading the PCI_INTERRUPT_PIN to know wether
the device has an interrupt at all, and the the PCI_INTERRUPT_LINE to get an
interrupt number from the device. That number is then mapped using the
default controller, and the trigger is set to level low. That default
behaviour works for several platforms that don't have a proper interrupt
tree like Pegasos. If it doesn't work for your platform, then either
provide a proper interrupt tree from the firmware so that fallback isn't
needed, or don't call pci_read_irq_line()
- Add back a bit that got dropped by my main rework patch for properly
clearing pending IPIs on pSeries when using a kexec
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-07-10 19:44:42 +08:00
|
|
|
unsigned int sense = type & IRQ_TYPE_SENSE_MASK;
|
2011-05-11 03:30:29 +08:00
|
|
|
struct spider_pic *pic = spider_irq_data_to_pic(d);
|
2011-05-04 13:02:15 +08:00
|
|
|
unsigned int hw = irqd_to_hwirq(d);
|
2006-07-03 19:36:01 +08:00
|
|
|
void __iomem *cfg = spider_get_irq_config(pic, hw);
|
[PATCH] powerpc: fix trigger handling in the new irq code
This patch slightly reworks the new irq code to fix a small design error. I
removed the passing of the trigger to the map() calls entirely, it was not a
good idea to have one call do two different things. It also fixes a couple of
corner cases.
Mapping a linux virtual irq to a physical irq now does only that. Setting the
trigger is a different action which has a different call.
The main changes are:
- I no longer call host->ops->map() for an already mapped irq, I just return
the virtual number that was already mapped. It was called before to give an
opportunity to change the trigger, but that was causing issues as that could
happen while the interrupt was in use by a device, and because of the
trigger change, map would potentially muck around with things in a racy way.
That was causing much burden on a given's controller implementation of
map() to get it right. This is much simpler now. map() is only called on
the initial mapping of an irq, meaning that you know that this irq is _not_
being used. You can initialize the hardware if you want (though you don't
have to).
- Controllers that can handle different type of triggers (level/edge/etc...)
now implement the standard irq_chip->set_type() call as defined by the
generic code. That means that you can use the standard set_irq_type() to
configure an irq line manually if you wish or (though I don't like that
interface), pass explicit trigger flags to request_irq() as defined by the
generic kernel interfaces. Also, using those interfaces guarantees that
your controller set_type callback is called with the descriptor lock held,
thus providing locking against activity on the same interrupt (including
mask/unmask/etc...) automatically. A result is that, for example, MPIC's
own map() implementation calls irq_set_type(NONE) to configure the hardware
to the default triggers.
- To allow the above, the irq_map array entry for the new mapped interrupt
is now set before map() callback is called for the controller.
- The irq_create_of_mapping() (also used by irq_of_parse_and_map()) function
for mapping interrupts from the device-tree now also call the separate
set_irq_type(), and only does so if there is a change in the trigger type.
- While I was at it, I changed pci_read_irq_line() (which is the helper I
would expect most archs to use in their pcibios_fixup() to get the PCI
interrupt routing from the device tree) to also handle a fallback when the
DT mapping fails consisting of reading the PCI_INTERRUPT_PIN to know wether
the device has an interrupt at all, and the the PCI_INTERRUPT_LINE to get an
interrupt number from the device. That number is then mapped using the
default controller, and the trigger is set to level low. That default
behaviour works for several platforms that don't have a proper interrupt
tree like Pegasos. If it doesn't work for your platform, then either
provide a proper interrupt tree from the firmware so that fallback isn't
needed, or don't call pci_read_irq_line()
- Add back a bit that got dropped by my main rework patch for properly
clearing pending IPIs on pSeries when using a kexec
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-07-10 19:44:42 +08:00
|
|
|
u32 old_mask;
|
2006-07-03 19:36:01 +08:00
|
|
|
u32 ic;
|
|
|
|
|
|
|
|
/* Note that only level high is supported for most interrupts */
|
|
|
|
if (sense != IRQ_TYPE_NONE && sense != IRQ_TYPE_LEVEL_HIGH &&
|
|
|
|
(hw < 47 || hw > 50))
|
|
|
|
return -EINVAL;
|
|
|
|
|
|
|
|
/* Decode sense type */
|
|
|
|
switch(sense) {
|
|
|
|
case IRQ_TYPE_EDGE_RISING:
|
|
|
|
ic = 0x3;
|
|
|
|
break;
|
|
|
|
case IRQ_TYPE_EDGE_FALLING:
|
|
|
|
ic = 0x2;
|
|
|
|
break;
|
|
|
|
case IRQ_TYPE_LEVEL_LOW:
|
|
|
|
ic = 0x0;
|
|
|
|
break;
|
|
|
|
case IRQ_TYPE_LEVEL_HIGH:
|
|
|
|
case IRQ_TYPE_NONE:
|
|
|
|
ic = 0x1;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
return -EINVAL;
|
|
|
|
}
|
2005-06-23 07:43:43 +08:00
|
|
|
|
2006-07-03 19:36:01 +08:00
|
|
|
/* Configure the source. One gross hack that was there before and
|
|
|
|
* that I've kept around is the priority to the BE which I set to
|
2012-09-20 09:48:00 +08:00
|
|
|
* be the same as the interrupt source number. I don't know whether
|
2006-07-03 19:36:01 +08:00
|
|
|
* that's supposed to make any kind of sense however, we'll have to
|
|
|
|
* decide that, but for now, I'm not changing the behaviour.
|
|
|
|
*/
|
[PATCH] powerpc: fix trigger handling in the new irq code
This patch slightly reworks the new irq code to fix a small design error. I
removed the passing of the trigger to the map() calls entirely, it was not a
good idea to have one call do two different things. It also fixes a couple of
corner cases.
Mapping a linux virtual irq to a physical irq now does only that. Setting the
trigger is a different action which has a different call.
The main changes are:
- I no longer call host->ops->map() for an already mapped irq, I just return
the virtual number that was already mapped. It was called before to give an
opportunity to change the trigger, but that was causing issues as that could
happen while the interrupt was in use by a device, and because of the
trigger change, map would potentially muck around with things in a racy way.
That was causing much burden on a given's controller implementation of
map() to get it right. This is much simpler now. map() is only called on
the initial mapping of an irq, meaning that you know that this irq is _not_
being used. You can initialize the hardware if you want (though you don't
have to).
- Controllers that can handle different type of triggers (level/edge/etc...)
now implement the standard irq_chip->set_type() call as defined by the
generic code. That means that you can use the standard set_irq_type() to
configure an irq line manually if you wish or (though I don't like that
interface), pass explicit trigger flags to request_irq() as defined by the
generic kernel interfaces. Also, using those interfaces guarantees that
your controller set_type callback is called with the descriptor lock held,
thus providing locking against activity on the same interrupt (including
mask/unmask/etc...) automatically. A result is that, for example, MPIC's
own map() implementation calls irq_set_type(NONE) to configure the hardware
to the default triggers.
- To allow the above, the irq_map array entry for the new mapped interrupt
is now set before map() callback is called for the controller.
- The irq_create_of_mapping() (also used by irq_of_parse_and_map()) function
for mapping interrupts from the device-tree now also call the separate
set_irq_type(), and only does so if there is a change in the trigger type.
- While I was at it, I changed pci_read_irq_line() (which is the helper I
would expect most archs to use in their pcibios_fixup() to get the PCI
interrupt routing from the device tree) to also handle a fallback when the
DT mapping fails consisting of reading the PCI_INTERRUPT_PIN to know wether
the device has an interrupt at all, and the the PCI_INTERRUPT_LINE to get an
interrupt number from the device. That number is then mapped using the
default controller, and the trigger is set to level low. That default
behaviour works for several platforms that don't have a proper interrupt
tree like Pegasos. If it doesn't work for your platform, then either
provide a proper interrupt tree from the firmware so that fallback isn't
needed, or don't call pci_read_irq_line()
- Add back a bit that got dropped by my main rework patch for properly
clearing pending IPIs on pSeries when using a kexec
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-07-10 19:44:42 +08:00
|
|
|
old_mask = in_be32(cfg) & 0x30000000u;
|
|
|
|
out_be32(cfg, old_mask | (ic << 24) | (0x7 << 16) |
|
|
|
|
(pic->node_id << 4) | 0xe);
|
2006-07-03 19:36:01 +08:00
|
|
|
out_be32(cfg + 4, (0x2 << 16) | (hw & 0xff));
|
2005-06-23 07:43:43 +08:00
|
|
|
|
[PATCH] powerpc: fix trigger handling in the new irq code
This patch slightly reworks the new irq code to fix a small design error. I
removed the passing of the trigger to the map() calls entirely, it was not a
good idea to have one call do two different things. It also fixes a couple of
corner cases.
Mapping a linux virtual irq to a physical irq now does only that. Setting the
trigger is a different action which has a different call.
The main changes are:
- I no longer call host->ops->map() for an already mapped irq, I just return
the virtual number that was already mapped. It was called before to give an
opportunity to change the trigger, but that was causing issues as that could
happen while the interrupt was in use by a device, and because of the
trigger change, map would potentially muck around with things in a racy way.
That was causing much burden on a given's controller implementation of
map() to get it right. This is much simpler now. map() is only called on
the initial mapping of an irq, meaning that you know that this irq is _not_
being used. You can initialize the hardware if you want (though you don't
have to).
- Controllers that can handle different type of triggers (level/edge/etc...)
now implement the standard irq_chip->set_type() call as defined by the
generic code. That means that you can use the standard set_irq_type() to
configure an irq line manually if you wish or (though I don't like that
interface), pass explicit trigger flags to request_irq() as defined by the
generic kernel interfaces. Also, using those interfaces guarantees that
your controller set_type callback is called with the descriptor lock held,
thus providing locking against activity on the same interrupt (including
mask/unmask/etc...) automatically. A result is that, for example, MPIC's
own map() implementation calls irq_set_type(NONE) to configure the hardware
to the default triggers.
- To allow the above, the irq_map array entry for the new mapped interrupt
is now set before map() callback is called for the controller.
- The irq_create_of_mapping() (also used by irq_of_parse_and_map()) function
for mapping interrupts from the device-tree now also call the separate
set_irq_type(), and only does so if there is a change in the trigger type.
- While I was at it, I changed pci_read_irq_line() (which is the helper I
would expect most archs to use in their pcibios_fixup() to get the PCI
interrupt routing from the device tree) to also handle a fallback when the
DT mapping fails consisting of reading the PCI_INTERRUPT_PIN to know wether
the device has an interrupt at all, and the the PCI_INTERRUPT_LINE to get an
interrupt number from the device. That number is then mapped using the
default controller, and the trigger is set to level low. That default
behaviour works for several platforms that don't have a proper interrupt
tree like Pegasos. If it doesn't work for your platform, then either
provide a proper interrupt tree from the firmware so that fallback isn't
needed, or don't call pci_read_irq_line()
- Add back a bit that got dropped by my main rework patch for properly
clearing pending IPIs on pSeries when using a kexec
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-07-10 19:44:42 +08:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static struct irq_chip spider_pic = {
|
2010-02-01 04:33:41 +08:00
|
|
|
.name = "SPIDER",
|
2011-03-07 21:59:28 +08:00
|
|
|
.irq_unmask = spider_unmask_irq,
|
|
|
|
.irq_mask = spider_mask_irq,
|
|
|
|
.irq_ack = spider_ack_irq,
|
|
|
|
.irq_set_type = spider_set_irq_type,
|
[PATCH] powerpc: fix trigger handling in the new irq code
This patch slightly reworks the new irq code to fix a small design error. I
removed the passing of the trigger to the map() calls entirely, it was not a
good idea to have one call do two different things. It also fixes a couple of
corner cases.
Mapping a linux virtual irq to a physical irq now does only that. Setting the
trigger is a different action which has a different call.
The main changes are:
- I no longer call host->ops->map() for an already mapped irq, I just return
the virtual number that was already mapped. It was called before to give an
opportunity to change the trigger, but that was causing issues as that could
happen while the interrupt was in use by a device, and because of the
trigger change, map would potentially muck around with things in a racy way.
That was causing much burden on a given's controller implementation of
map() to get it right. This is much simpler now. map() is only called on
the initial mapping of an irq, meaning that you know that this irq is _not_
being used. You can initialize the hardware if you want (though you don't
have to).
- Controllers that can handle different type of triggers (level/edge/etc...)
now implement the standard irq_chip->set_type() call as defined by the
generic code. That means that you can use the standard set_irq_type() to
configure an irq line manually if you wish or (though I don't like that
interface), pass explicit trigger flags to request_irq() as defined by the
generic kernel interfaces. Also, using those interfaces guarantees that
your controller set_type callback is called with the descriptor lock held,
thus providing locking against activity on the same interrupt (including
mask/unmask/etc...) automatically. A result is that, for example, MPIC's
own map() implementation calls irq_set_type(NONE) to configure the hardware
to the default triggers.
- To allow the above, the irq_map array entry for the new mapped interrupt
is now set before map() callback is called for the controller.
- The irq_create_of_mapping() (also used by irq_of_parse_and_map()) function
for mapping interrupts from the device-tree now also call the separate
set_irq_type(), and only does so if there is a change in the trigger type.
- While I was at it, I changed pci_read_irq_line() (which is the helper I
would expect most archs to use in their pcibios_fixup() to get the PCI
interrupt routing from the device tree) to also handle a fallback when the
DT mapping fails consisting of reading the PCI_INTERRUPT_PIN to know wether
the device has an interrupt at all, and the the PCI_INTERRUPT_LINE to get an
interrupt number from the device. That number is then mapped using the
default controller, and the trigger is set to level low. That default
behaviour works for several platforms that don't have a proper interrupt
tree like Pegasos. If it doesn't work for your platform, then either
provide a proper interrupt tree from the firmware so that fallback isn't
needed, or don't call pci_read_irq_line()
- Add back a bit that got dropped by my main rework patch for properly
clearing pending IPIs on pSeries when using a kexec
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-07-10 19:44:42 +08:00
|
|
|
};
|
|
|
|
|
2012-02-15 05:06:50 +08:00
|
|
|
static int spider_host_map(struct irq_domain *h, unsigned int virq,
|
[PATCH] powerpc: fix trigger handling in the new irq code
This patch slightly reworks the new irq code to fix a small design error. I
removed the passing of the trigger to the map() calls entirely, it was not a
good idea to have one call do two different things. It also fixes a couple of
corner cases.
Mapping a linux virtual irq to a physical irq now does only that. Setting the
trigger is a different action which has a different call.
The main changes are:
- I no longer call host->ops->map() for an already mapped irq, I just return
the virtual number that was already mapped. It was called before to give an
opportunity to change the trigger, but that was causing issues as that could
happen while the interrupt was in use by a device, and because of the
trigger change, map would potentially muck around with things in a racy way.
That was causing much burden on a given's controller implementation of
map() to get it right. This is much simpler now. map() is only called on
the initial mapping of an irq, meaning that you know that this irq is _not_
being used. You can initialize the hardware if you want (though you don't
have to).
- Controllers that can handle different type of triggers (level/edge/etc...)
now implement the standard irq_chip->set_type() call as defined by the
generic code. That means that you can use the standard set_irq_type() to
configure an irq line manually if you wish or (though I don't like that
interface), pass explicit trigger flags to request_irq() as defined by the
generic kernel interfaces. Also, using those interfaces guarantees that
your controller set_type callback is called with the descriptor lock held,
thus providing locking against activity on the same interrupt (including
mask/unmask/etc...) automatically. A result is that, for example, MPIC's
own map() implementation calls irq_set_type(NONE) to configure the hardware
to the default triggers.
- To allow the above, the irq_map array entry for the new mapped interrupt
is now set before map() callback is called for the controller.
- The irq_create_of_mapping() (also used by irq_of_parse_and_map()) function
for mapping interrupts from the device-tree now also call the separate
set_irq_type(), and only does so if there is a change in the trigger type.
- While I was at it, I changed pci_read_irq_line() (which is the helper I
would expect most archs to use in their pcibios_fixup() to get the PCI
interrupt routing from the device tree) to also handle a fallback when the
DT mapping fails consisting of reading the PCI_INTERRUPT_PIN to know wether
the device has an interrupt at all, and the the PCI_INTERRUPT_LINE to get an
interrupt number from the device. That number is then mapped using the
default controller, and the trigger is set to level low. That default
behaviour works for several platforms that don't have a proper interrupt
tree like Pegasos. If it doesn't work for your platform, then either
provide a proper interrupt tree from the firmware so that fallback isn't
needed, or don't call pci_read_irq_line()
- Add back a bit that got dropped by my main rework patch for properly
clearing pending IPIs on pSeries when using a kexec
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-07-10 19:44:42 +08:00
|
|
|
irq_hw_number_t hw)
|
|
|
|
{
|
2011-05-11 03:30:29 +08:00
|
|
|
irq_set_chip_data(virq, h->host_data);
|
2011-03-25 23:45:20 +08:00
|
|
|
irq_set_chip_and_handler(virq, &spider_pic, handle_level_irq);
|
[PATCH] powerpc: fix trigger handling in the new irq code
This patch slightly reworks the new irq code to fix a small design error. I
removed the passing of the trigger to the map() calls entirely, it was not a
good idea to have one call do two different things. It also fixes a couple of
corner cases.
Mapping a linux virtual irq to a physical irq now does only that. Setting the
trigger is a different action which has a different call.
The main changes are:
- I no longer call host->ops->map() for an already mapped irq, I just return
the virtual number that was already mapped. It was called before to give an
opportunity to change the trigger, but that was causing issues as that could
happen while the interrupt was in use by a device, and because of the
trigger change, map would potentially muck around with things in a racy way.
That was causing much burden on a given's controller implementation of
map() to get it right. This is much simpler now. map() is only called on
the initial mapping of an irq, meaning that you know that this irq is _not_
being used. You can initialize the hardware if you want (though you don't
have to).
- Controllers that can handle different type of triggers (level/edge/etc...)
now implement the standard irq_chip->set_type() call as defined by the
generic code. That means that you can use the standard set_irq_type() to
configure an irq line manually if you wish or (though I don't like that
interface), pass explicit trigger flags to request_irq() as defined by the
generic kernel interfaces. Also, using those interfaces guarantees that
your controller set_type callback is called with the descriptor lock held,
thus providing locking against activity on the same interrupt (including
mask/unmask/etc...) automatically. A result is that, for example, MPIC's
own map() implementation calls irq_set_type(NONE) to configure the hardware
to the default triggers.
- To allow the above, the irq_map array entry for the new mapped interrupt
is now set before map() callback is called for the controller.
- The irq_create_of_mapping() (also used by irq_of_parse_and_map()) function
for mapping interrupts from the device-tree now also call the separate
set_irq_type(), and only does so if there is a change in the trigger type.
- While I was at it, I changed pci_read_irq_line() (which is the helper I
would expect most archs to use in their pcibios_fixup() to get the PCI
interrupt routing from the device tree) to also handle a fallback when the
DT mapping fails consisting of reading the PCI_INTERRUPT_PIN to know wether
the device has an interrupt at all, and the the PCI_INTERRUPT_LINE to get an
interrupt number from the device. That number is then mapped using the
default controller, and the trigger is set to level low. That default
behaviour works for several platforms that don't have a proper interrupt
tree like Pegasos. If it doesn't work for your platform, then either
provide a proper interrupt tree from the firmware so that fallback isn't
needed, or don't call pci_read_irq_line()
- Add back a bit that got dropped by my main rework patch for properly
clearing pending IPIs on pSeries when using a kexec
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-07-10 19:44:42 +08:00
|
|
|
|
|
|
|
/* Set default irq type */
|
2011-03-25 23:45:20 +08:00
|
|
|
irq_set_irq_type(virq, IRQ_TYPE_NONE);
|
[PATCH] powerpc: fix trigger handling in the new irq code
This patch slightly reworks the new irq code to fix a small design error. I
removed the passing of the trigger to the map() calls entirely, it was not a
good idea to have one call do two different things. It also fixes a couple of
corner cases.
Mapping a linux virtual irq to a physical irq now does only that. Setting the
trigger is a different action which has a different call.
The main changes are:
- I no longer call host->ops->map() for an already mapped irq, I just return
the virtual number that was already mapped. It was called before to give an
opportunity to change the trigger, but that was causing issues as that could
happen while the interrupt was in use by a device, and because of the
trigger change, map would potentially muck around with things in a racy way.
That was causing much burden on a given's controller implementation of
map() to get it right. This is much simpler now. map() is only called on
the initial mapping of an irq, meaning that you know that this irq is _not_
being used. You can initialize the hardware if you want (though you don't
have to).
- Controllers that can handle different type of triggers (level/edge/etc...)
now implement the standard irq_chip->set_type() call as defined by the
generic code. That means that you can use the standard set_irq_type() to
configure an irq line manually if you wish or (though I don't like that
interface), pass explicit trigger flags to request_irq() as defined by the
generic kernel interfaces. Also, using those interfaces guarantees that
your controller set_type callback is called with the descriptor lock held,
thus providing locking against activity on the same interrupt (including
mask/unmask/etc...) automatically. A result is that, for example, MPIC's
own map() implementation calls irq_set_type(NONE) to configure the hardware
to the default triggers.
- To allow the above, the irq_map array entry for the new mapped interrupt
is now set before map() callback is called for the controller.
- The irq_create_of_mapping() (also used by irq_of_parse_and_map()) function
for mapping interrupts from the device-tree now also call the separate
set_irq_type(), and only does so if there is a change in the trigger type.
- While I was at it, I changed pci_read_irq_line() (which is the helper I
would expect most archs to use in their pcibios_fixup() to get the PCI
interrupt routing from the device tree) to also handle a fallback when the
DT mapping fails consisting of reading the PCI_INTERRUPT_PIN to know wether
the device has an interrupt at all, and the the PCI_INTERRUPT_LINE to get an
interrupt number from the device. That number is then mapped using the
default controller, and the trigger is set to level low. That default
behaviour works for several platforms that don't have a proper interrupt
tree like Pegasos. If it doesn't work for your platform, then either
provide a proper interrupt tree from the firmware so that fallback isn't
needed, or don't call pci_read_irq_line()
- Add back a bit that got dropped by my main rework patch for properly
clearing pending IPIs on pSeries when using a kexec
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-07-10 19:44:42 +08:00
|
|
|
|
2006-07-03 19:36:01 +08:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2012-02-15 05:06:50 +08:00
|
|
|
static int spider_host_xlate(struct irq_domain *h, struct device_node *ct,
|
2009-12-08 10:39:50 +08:00
|
|
|
const u32 *intspec, unsigned int intsize,
|
2006-07-03 19:36:01 +08:00
|
|
|
irq_hw_number_t *out_hwirq, unsigned int *out_flags)
|
|
|
|
|
|
|
|
{
|
|
|
|
/* Spider interrupts have 2 cells, first is the interrupt source,
|
|
|
|
* second, well, I don't know for sure yet ... We mask the top bits
|
|
|
|
* because old device-trees encode a node number in there
|
|
|
|
*/
|
|
|
|
*out_hwirq = intspec[0] & 0x3f;
|
|
|
|
*out_flags = IRQ_TYPE_LEVEL_HIGH;
|
|
|
|
return 0;
|
2005-06-23 07:43:43 +08:00
|
|
|
}
|
2006-03-23 07:00:06 +08:00
|
|
|
|
2012-01-27 03:24:34 +08:00
|
|
|
static const struct irq_domain_ops spider_host_ops = {
|
2006-07-03 19:36:01 +08:00
|
|
|
.map = spider_host_map,
|
|
|
|
.xlate = spider_host_xlate,
|
|
|
|
};
|
|
|
|
|
2015-09-14 16:42:37 +08:00
|
|
|
static void spider_irq_cascade(struct irq_desc *desc)
|
2006-07-03 17:32:51 +08:00
|
|
|
{
|
2011-03-25 23:45:20 +08:00
|
|
|
struct irq_chip *chip = irq_desc_get_chip(desc);
|
|
|
|
struct spider_pic *pic = irq_desc_get_handler_data(desc);
|
2006-07-03 19:36:01 +08:00
|
|
|
unsigned int cs, virq;
|
2006-07-03 17:32:51 +08:00
|
|
|
|
2006-07-03 19:36:01 +08:00
|
|
|
cs = in_be32(pic->regs + TIR_CS) >> 24;
|
|
|
|
if (cs == SPIDER_IRQ_INVALID)
|
2016-09-06 19:53:24 +08:00
|
|
|
virq = 0;
|
2006-07-03 19:36:01 +08:00
|
|
|
else
|
|
|
|
virq = irq_linear_revmap(pic->host, cs);
|
2011-03-07 21:59:28 +08:00
|
|
|
|
2016-09-06 19:53:24 +08:00
|
|
|
if (virq)
|
IRQ: Maintain regs pointer globally rather than passing to IRQ handlers
Maintain a per-CPU global "struct pt_regs *" variable which can be used instead
of passing regs around manually through all ~1800 interrupt handlers in the
Linux kernel.
The regs pointer is used in few places, but it potentially costs both stack
space and code to pass it around. On the FRV arch, removing the regs parameter
from all the genirq function results in a 20% speed up of the IRQ exit path
(ie: from leaving timer_interrupt() to leaving do_IRQ()).
Where appropriate, an arch may override the generic storage facility and do
something different with the variable. On FRV, for instance, the address is
maintained in GR28 at all times inside the kernel as part of general exception
handling.
Having looked over the code, it appears that the parameter may be handed down
through up to twenty or so layers of functions. Consider a USB character
device attached to a USB hub, attached to a USB controller that posts its
interrupts through a cascaded auxiliary interrupt controller. A character
device driver may want to pass regs to the sysrq handler through the input
layer which adds another few layers of parameter passing.
I've build this code with allyesconfig for x86_64 and i386. I've runtested the
main part of the code on FRV and i386, though I can't test most of the drivers.
I've also done partial conversion for powerpc and MIPS - these at least compile
with minimal configurations.
This will affect all archs. Mostly the changes should be relatively easy.
Take do_IRQ(), store the regs pointer at the beginning, saving the old one:
struct pt_regs *old_regs = set_irq_regs(regs);
And put the old one back at the end:
set_irq_regs(old_regs);
Don't pass regs through to generic_handle_irq() or __do_IRQ().
In timer_interrupt(), this sort of change will be necessary:
- update_process_times(user_mode(regs));
- profile_tick(CPU_PROFILING, regs);
+ update_process_times(user_mode(get_irq_regs()));
+ profile_tick(CPU_PROFILING);
I'd like to move update_process_times()'s use of get_irq_regs() into itself,
except that i386, alone of the archs, uses something other than user_mode().
Some notes on the interrupt handling in the drivers:
(*) input_dev() is now gone entirely. The regs pointer is no longer stored in
the input_dev struct.
(*) finish_unlinks() in drivers/usb/host/ohci-q.c needs checking. It does
something different depending on whether it's been supplied with a regs
pointer or not.
(*) Various IRQ handler function pointers have been moved to type
irq_handler_t.
Signed-Off-By: David Howells <dhowells@redhat.com>
(cherry picked from 1b16e7ac850969f38b375e511e3fa2f474a33867 commit)
2006-10-05 21:55:46 +08:00
|
|
|
generic_handle_irq(virq);
|
2011-03-07 21:59:28 +08:00
|
|
|
|
|
|
|
chip->irq_eoi(&desc->irq_data);
|
2006-07-03 17:32:51 +08:00
|
|
|
}
|
|
|
|
|
2016-06-01 14:34:37 +08:00
|
|
|
/* For hooking up the cascade we have a problem. Our device-tree is
|
2006-07-03 19:36:01 +08:00
|
|
|
* crap and we don't know on which BE iic interrupt we are hooked on at
|
|
|
|
* least not the "standard" way. We can reconstitute it based on two
|
2012-09-20 09:48:00 +08:00
|
|
|
* informations though: which BE node we are connected to and whether
|
2006-07-03 19:36:01 +08:00
|
|
|
* we are connected to IOIF0 or IOIF1. Right now, we really only care
|
|
|
|
* about the IBM cell blade and we know that its firmware gives us an
|
|
|
|
* interrupt-map property which is pretty strange.
|
|
|
|
*/
|
|
|
|
static unsigned int __init spider_find_cascade_and_node(struct spider_pic *pic)
|
|
|
|
{
|
|
|
|
unsigned int virq;
|
2006-07-12 13:39:54 +08:00
|
|
|
const u32 *imap, *tmp;
|
2006-07-03 19:36:01 +08:00
|
|
|
int imaplen, intsize, unit;
|
|
|
|
struct device_node *iic;
|
2015-10-13 19:51:29 +08:00
|
|
|
struct device_node *of_node;
|
|
|
|
|
|
|
|
of_node = irq_domain_get_of_node(pic->host);
|
2006-07-03 19:36:01 +08:00
|
|
|
|
2012-09-20 09:48:00 +08:00
|
|
|
/* First, we check whether we have a real "interrupts" in the device
|
2006-07-03 19:36:01 +08:00
|
|
|
* tree in case the device-tree is ever fixed
|
|
|
|
*/
|
2015-10-13 19:51:29 +08:00
|
|
|
virq = irq_of_parse_and_map(of_node, 0);
|
2013-09-18 21:24:44 +08:00
|
|
|
if (virq)
|
|
|
|
return virq;
|
2006-07-03 19:36:01 +08:00
|
|
|
|
|
|
|
/* Now do the horrible hacks */
|
2015-10-13 19:51:29 +08:00
|
|
|
tmp = of_get_property(of_node, "#interrupt-cells", NULL);
|
2006-07-03 19:36:01 +08:00
|
|
|
if (tmp == NULL)
|
2016-09-06 19:53:24 +08:00
|
|
|
return 0;
|
2006-07-03 19:36:01 +08:00
|
|
|
intsize = *tmp;
|
2015-10-13 19:51:29 +08:00
|
|
|
imap = of_get_property(of_node, "interrupt-map", &imaplen);
|
2006-07-03 19:36:01 +08:00
|
|
|
if (imap == NULL || imaplen < (intsize + 1))
|
2016-09-06 19:53:24 +08:00
|
|
|
return 0;
|
2006-07-03 19:36:01 +08:00
|
|
|
iic = of_find_node_by_phandle(imap[intsize]);
|
|
|
|
if (iic == NULL)
|
2016-09-06 19:53:24 +08:00
|
|
|
return 0;
|
2006-07-03 19:36:01 +08:00
|
|
|
imap += intsize + 1;
|
2007-04-03 20:26:41 +08:00
|
|
|
tmp = of_get_property(iic, "#interrupt-cells", NULL);
|
2010-08-29 07:52:46 +08:00
|
|
|
if (tmp == NULL) {
|
|
|
|
of_node_put(iic);
|
2016-09-06 19:53:24 +08:00
|
|
|
return 0;
|
2010-08-29 07:52:46 +08:00
|
|
|
}
|
2006-07-03 19:36:01 +08:00
|
|
|
intsize = *tmp;
|
|
|
|
/* Assume unit is last entry of interrupt specifier */
|
|
|
|
unit = imap[intsize - 1];
|
|
|
|
/* Ok, we have a unit, now let's try to get the node */
|
2007-04-03 20:26:41 +08:00
|
|
|
tmp = of_get_property(iic, "ibm,interrupt-server-ranges", NULL);
|
2006-07-03 19:36:01 +08:00
|
|
|
if (tmp == NULL) {
|
|
|
|
of_node_put(iic);
|
2016-09-06 19:53:24 +08:00
|
|
|
return 0;
|
2006-07-03 19:36:01 +08:00
|
|
|
}
|
|
|
|
/* ugly as hell but works for now */
|
|
|
|
pic->node_id = (*tmp) >> 1;
|
|
|
|
of_node_put(iic);
|
|
|
|
|
|
|
|
/* Ok, now let's get cracking. You may ask me why I just didn't match
|
|
|
|
* the iic host from the iic OF node, but that way I'm still compatible
|
|
|
|
* with really really old old firmwares for which we don't have a node
|
|
|
|
*/
|
|
|
|
/* Manufacture an IIC interrupt number of class 2 */
|
2006-09-29 13:00:29 +08:00
|
|
|
virq = irq_create_mapping(NULL,
|
|
|
|
(pic->node_id << IIC_IRQ_NODE_SHIFT) |
|
|
|
|
(2 << IIC_IRQ_CLASS_SHIFT) |
|
|
|
|
unit);
|
2016-09-06 19:53:24 +08:00
|
|
|
if (!virq)
|
2006-07-03 19:36:01 +08:00
|
|
|
printk(KERN_ERR "spider_pic: failed to map cascade !");
|
|
|
|
return virq;
|
|
|
|
}
|
|
|
|
|
2006-03-23 07:00:06 +08:00
|
|
|
|
2006-07-03 19:36:01 +08:00
|
|
|
static void __init spider_init_one(struct device_node *of_node, int chip,
|
|
|
|
unsigned long addr)
|
2005-06-23 07:43:43 +08:00
|
|
|
{
|
2006-07-03 19:36:01 +08:00
|
|
|
struct spider_pic *pic = &spider_pics[chip];
|
|
|
|
int i, virq;
|
2006-07-03 17:32:51 +08:00
|
|
|
|
2006-07-03 19:36:01 +08:00
|
|
|
/* Map registers */
|
|
|
|
pic->regs = ioremap(addr, 0x1000);
|
|
|
|
if (pic->regs == NULL)
|
2006-07-03 17:32:51 +08:00
|
|
|
panic("spider_pic: can't map registers !");
|
|
|
|
|
2006-07-03 19:36:01 +08:00
|
|
|
/* Allocate a host */
|
2012-02-15 05:06:54 +08:00
|
|
|
pic->host = irq_domain_add_linear(of_node, SPIDER_SRC_COUNT,
|
|
|
|
&spider_host_ops, pic);
|
2006-07-03 19:36:01 +08:00
|
|
|
if (pic->host == NULL)
|
|
|
|
panic("spider_pic: can't allocate irq host !");
|
2006-07-03 17:32:51 +08:00
|
|
|
|
2006-07-03 19:36:01 +08:00
|
|
|
/* Go through all sources and disable them */
|
|
|
|
for (i = 0; i < SPIDER_SRC_COUNT; i++) {
|
|
|
|
void __iomem *cfg = pic->regs + TIR_CFGA + 8 * i;
|
|
|
|
out_be32(cfg, in_be32(cfg) & ~0x30000000u);
|
2006-03-23 07:00:06 +08:00
|
|
|
}
|
2006-07-03 17:32:51 +08:00
|
|
|
|
|
|
|
/* do not mask any interrupts because of level */
|
2006-07-03 19:36:01 +08:00
|
|
|
out_be32(pic->regs + TIR_MSK, 0x0);
|
2006-07-03 17:32:51 +08:00
|
|
|
|
|
|
|
/* enable interrupt packets to be output */
|
2006-07-03 19:36:01 +08:00
|
|
|
out_be32(pic->regs + TIR_PIEN, in_be32(pic->regs + TIR_PIEN) | 0x1);
|
2006-07-03 17:32:51 +08:00
|
|
|
|
2006-07-03 19:36:01 +08:00
|
|
|
/* Hook up the cascade interrupt to the iic and nodeid */
|
|
|
|
virq = spider_find_cascade_and_node(pic);
|
2016-09-06 19:53:24 +08:00
|
|
|
if (!virq)
|
2006-07-03 19:36:01 +08:00
|
|
|
return;
|
2011-03-25 23:45:20 +08:00
|
|
|
irq_set_handler_data(virq, pic);
|
|
|
|
irq_set_chained_handler(virq, spider_irq_cascade);
|
2006-07-03 19:36:01 +08:00
|
|
|
|
2017-08-21 23:16:47 +08:00
|
|
|
printk(KERN_INFO "spider_pic: node %d, addr: 0x%lx %pOF\n",
|
|
|
|
pic->node_id, addr, of_node);
|
2006-07-03 17:32:51 +08:00
|
|
|
|
|
|
|
/* Enable the interrupt detection enable bit. Do this last! */
|
2006-07-03 19:36:01 +08:00
|
|
|
out_be32(pic->regs + TIR_DEN, in_be32(pic->regs + TIR_DEN) | 0x1);
|
2006-03-23 07:00:06 +08:00
|
|
|
}
|
|
|
|
|
2006-07-03 17:32:51 +08:00
|
|
|
void __init spider_init_IRQ(void)
|
2006-03-23 07:00:06 +08:00
|
|
|
{
|
2006-07-03 19:36:01 +08:00
|
|
|
struct resource r;
|
2006-03-23 07:00:06 +08:00
|
|
|
struct device_node *dn;
|
2006-07-03 19:36:01 +08:00
|
|
|
int chip = 0;
|
|
|
|
|
|
|
|
/* XXX node numbers are totally bogus. We _hope_ we get the device
|
|
|
|
* nodes in the right order here but that's definitely not guaranteed,
|
|
|
|
* we need to get the node from the device tree instead.
|
|
|
|
* There is currently no proper property for it (but our whole
|
|
|
|
* device-tree is bogus anyway) so all we can do is pray or maybe test
|
|
|
|
* the address and deduce the node-id
|
2006-07-03 17:32:51 +08:00
|
|
|
*/
|
2017-02-01 09:54:37 +08:00
|
|
|
for_each_node_by_name(dn, "interrupt-controller") {
|
2007-05-03 15:26:52 +08:00
|
|
|
if (of_device_is_compatible(dn, "CBEA,platform-spider-pic")) {
|
2006-07-03 19:36:01 +08:00
|
|
|
if (of_address_to_resource(dn, 0, &r)) {
|
|
|
|
printk(KERN_WARNING "spider-pic: Failed\n");
|
|
|
|
continue;
|
|
|
|
}
|
2007-05-03 15:26:52 +08:00
|
|
|
} else if (of_device_is_compatible(dn, "sti,platform-spider-pic")
|
2006-07-03 19:36:01 +08:00
|
|
|
&& (chip < 2)) {
|
|
|
|
static long hard_coded_pics[] =
|
2006-10-04 23:26:24 +08:00
|
|
|
{ 0x24000008000ul, 0x34000008000ul};
|
2006-07-03 19:36:01 +08:00
|
|
|
r.start = hard_coded_pics[chip];
|
2006-03-23 07:00:06 +08:00
|
|
|
} else
|
|
|
|
continue;
|
2006-07-03 19:36:01 +08:00
|
|
|
spider_init_one(dn, chip++, r.start);
|
2005-06-23 07:43:43 +08:00
|
|
|
}
|
|
|
|
}
|