sh: shmin updates.
This fixes up shmin (and SH7706/SH7708) IPR support for some of the recent API changes. Signed-off-by: Takashi YOSHII <takasi-y@ops.dti.ne.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
此提交包含在:
@@ -43,16 +43,29 @@ static struct irq_chip ipr_irq_chip = {
|
||||
.mask_ack = disable_ipr_irq,
|
||||
};
|
||||
|
||||
unsigned int map_ipridx_to_addr(int idx) __attribute__ ((weak));
|
||||
unsigned int map_ipridx_to_addr(int idx)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void make_ipr_irq(struct ipr_data *table, unsigned int nr_irqs)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < nr_irqs; i++) {
|
||||
unsigned int irq = table[i].irq;
|
||||
table[i].addr = map_ipridx_to_addr(table[i].ipr_idx);
|
||||
|
||||
if (!irq)
|
||||
irq = table[i].irq = i;
|
||||
|
||||
/* could the IPR index be mapped, if not we ignore this */
|
||||
if (table[i].addr == 0)
|
||||
continue;
|
||||
if (!table[i].addr) {
|
||||
table[i].addr = map_ipridx_to_addr(table[i].ipr_idx);
|
||||
if (!table[i].addr)
|
||||
continue;
|
||||
}
|
||||
|
||||
disable_irq_nosync(irq);
|
||||
set_irq_chip_and_handler_name(irq, &ipr_irq_chip,
|
||||
handle_level_irq, "level");
|
||||
|
@@ -51,3 +51,24 @@ static int __init sh7709_devices_setup(void)
|
||||
ARRAY_SIZE(sh7709_devices));
|
||||
}
|
||||
__initcall(sh7709_devices_setup);
|
||||
|
||||
#define IPRx(A,N) .addr=A, .shift=0*N*-1
|
||||
#define IPRA(N) IPRx(0xfffffee2UL,N)
|
||||
#define IPRB(N) IPRx(0xfffffee4UL,N)
|
||||
#define IPRE(N) IPRx(0xa400001aUL,N)
|
||||
|
||||
static struct ipr_data sh7709_ipr_map[] = {
|
||||
[16] = { IPRA(15-12), 2 }, /* TMU TUNI0 */
|
||||
[17] = { IPRA(11-8), 4 }, /* TMU TUNI1 */
|
||||
[22] = { IPRA(3-0), 2 }, /* RTC CUI */
|
||||
[23 ... 26] = { IPRB(7-4), 3 }, /* SCI */
|
||||
[27] = { IPRB(15-12), 2 }, /* WDT ITI */
|
||||
[48 ... 51] = { IPRE(15-12), 7 }, /* DMA */
|
||||
[52 ... 55] = { IPRE(11-8), 3 }, /* IRDA */
|
||||
[56 ... 59] = { IPRE(7-4), 3 }, /* SCIF */
|
||||
};
|
||||
|
||||
void __init init_IRQ_ipr()
|
||||
{
|
||||
make_ipr_irq(sh7709_ipr_map, ARRAY_SIZE(sh7709_ipr_map));
|
||||
}
|
||||
|
新增問題並參考
封鎖使用者