Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6044cf1d authored by David Howells's avatar David Howells
Browse files

MN10300: ASB2364: Handle the IRQ multiplexer in the FPGA



Handle the IRQ multiplexer in the FPGA by implementing a cascade interrupt
driver for it.

Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
parent 730c1fad
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -21,11 +21,15 @@
/* this number is used when no interrupt has been assigned */
#define NO_IRQ		INT_MAX

/* hardware irq numbers */
#ifdef CONFIG_SMP
#define NR_IRQS		GxICR_NUM_EXT_IRQS
/*
 * hardware irq numbers
 * - the ASB2364 has an FPGA with an IRQ multiplexer on it
 */
#ifdef CONFIG_MN10300_UNIT_ASB2364
#include <unit/irq.h>
#else
#define NR_IRQS		GxICR_NUM_IRQS
#define NR_CPU_IRQS	GxICR_NUM_IRQS
#define NR_IRQS		NR_CPU_IRQS
#endif

/* external hardware irq numbers */
+10 −3
Original line number Diff line number Diff line
@@ -381,9 +381,16 @@ int show_interrupts(struct seq_file *p, void *v)
			seq_printf(p, "%3d: ", i);
			for_each_present_cpu(cpu)
				seq_printf(p, "%10u ", kstat_irqs_cpu(i, cpu));
			seq_printf(p, " %14s.%u", irq_desc[i].chip->name,

			if (i < NR_CPU_IRQS)
				seq_printf(p, " %14s.%u",
					   irq_desc[i].chip->name,
					   (GxICR(i) & GxICR_LEVEL) >>
					   GxICR_LEVEL_SHIFT);
			else
				seq_printf(p, " %14s",
					   irq_desc[i].chip->name);

			seq_printf(p, "  %s", action->name);

			for (action = action->next;
+1 −1
Original line number Diff line number Diff line
@@ -7,4 +7,4 @@
#
# Note 2! The CFLAGS definitions are now in the main makefile...

obj-y   := unit-init.o leds.o
obj-y   := unit-init.o leds.o irq-fpga.o
+13 −11
Original line number Diff line number Diff line
@@ -14,17 +14,19 @@
#define ASB2364_FPGA_REG_RESET_USB	__SYSREG(0xa900130c, u16)
#define ASB2364_FPGA_REG_RESET_AV	__SYSREG(0xa9001310, u16)

#define ASB2364_FPGA_REG_IRQ_LAN	__SYSREG(0xa9001510, u16)
#define ASB2364_FPGA_REG_IRQ_UART	__SYSREG(0xa9001514, u16)
#define ASB2364_FPGA_REG_IRQ_I2C	__SYSREG(0xa9001518, u16)
#define ASB2364_FPGA_REG_IRQ_USB	__SYSREG(0xa900151c, u16)
#define ASB2364_FPGA_REG_IRQ_FPGA	__SYSREG(0xa9001524, u16)

#define ASB2364_FPGA_REG_MASK_LAN	__SYSREG(0xa9001590, u16)
#define ASB2364_FPGA_REG_MASK_UART	__SYSREG(0xa9001594, u16)
#define ASB2364_FPGA_REG_MASK_I2C	__SYSREG(0xa9001598, u16)
#define ASB2364_FPGA_REG_MASK_USB	__SYSREG(0xa900159c, u16)
#define ASB2364_FPGA_REG_MASK_FPGA	__SYSREG(0xa90015a4, u16)
#define ASB2364_FPGA_REG_IRQ(X)		__SYSREG(0xa9001590+((X)*4), u16)
#define ASB2364_FPGA_REG_IRQ_LAN	ASB2364_FPGA_REG_IRQ(0)
#define ASB2364_FPGA_REG_IRQ_UART	ASB2364_FPGA_REG_IRQ(1)
#define ASB2364_FPGA_REG_IRQ_I2C	ASB2364_FPGA_REG_IRQ(2)
#define ASB2364_FPGA_REG_IRQ_USB	ASB2364_FPGA_REG_IRQ(3)
#define ASB2364_FPGA_REG_IRQ_FPGA	ASB2364_FPGA_REG_IRQ(5)

#define ASB2364_FPGA_REG_MASK(X)	__SYSREG(0xa9001590+((X)*4), u16)
#define ASB2364_FPGA_REG_MASK_LAN	ASB2364_FPGA_REG_MASK(0)
#define ASB2364_FPGA_REG_MASK_UART	ASB2364_FPGA_REG_MASK(1)
#define ASB2364_FPGA_REG_MASK_I2C	ASB2364_FPGA_REG_MASK(2)
#define ASB2364_FPGA_REG_MASK_USB	ASB2364_FPGA_REG_MASK(3)
#define ASB2364_FPGA_REG_MASK_FPGA	ASB2364_FPGA_REG_MASK(5)

#define ASB2364_FPGA_REG_CPLD5_SET1	__SYSREG(0xa9002500, u16)
#define ASB2364_FPGA_REG_CPLD5_SET2	__SYSREG(0xa9002504, u16)
+35 −0
Original line number Diff line number Diff line
/* ASB2364 FPGA irq numbers
 *
 * Copyright (C) 2010 Red Hat, Inc. All Rights Reserved.
 * Written by David Howells (dhowells@redhat.com)
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public Licence
 * as published by the Free Software Foundation; either version
 * 2 of the Licence, or (at your option) any later version.
 */
#ifndef _UNIT_IRQ_H
#define _UNIT_IRQ_H

#ifndef __ASSEMBLY__

#ifdef CONFIG_SMP
#define NR_CPU_IRQS	GxICR_NUM_EXT_IRQS
#else
#define NR_CPU_IRQS	GxICR_NUM_IRQS
#endif

enum {
	FPGA_LAN_IRQ	= NR_CPU_IRQS,
	FPGA_UART_IRQ,
	FPGA_I2C_IRQ,
	FPGA_USB_IRQ,
	FPGA_RESERVED_IRQ,
	FPGA_FPGA_IRQ,
	NR_IRQS
};

extern void __init irq_fpga_init(void);

#endif /* !__ASSEMBLY__ */
#endif /* _UNIT_IRQ_H */
Loading