diff options
author | David Howells <dhowells@redhat.com> | 2011-03-18 12:52:54 -0400 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2011-03-18 12:52:54 -0400 |
commit | ddb7d1e975d224885397c002512ded987be3c3bc (patch) | |
tree | c24cbe7132c243450aa11939f4d88a2bde8ed6e0 /arch/mn10300 | |
parent | 02b2944cd70c3166984699dd623612e2f8a3eebf (diff) |
MN10300: Clear ASB2364 peripheral interrupt masks before enabling interrupts
Clear the interrupt mask registers of ASB2364 peripherals before enabling
interrupts so that any peripherals that weren't dealt with by the bootloader
after a reboot (if there was one) won't cause an interrupt storm when
interrupts are first enabled before the drivers are initialised.
Also, attempt to reset the peripherals attached to the FPGA.
Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'arch/mn10300')
-rw-r--r-- | arch/mn10300/unit-asb2364/irq-fpga.c | 11 | ||||
-rw-r--r-- | arch/mn10300/unit-asb2364/unit-init.c | 44 |
2 files changed, 55 insertions, 0 deletions
diff --git a/arch/mn10300/unit-asb2364/irq-fpga.c b/arch/mn10300/unit-asb2364/irq-fpga.c index 4204a6c62a25..ee84e62b16ed 100644 --- a/arch/mn10300/unit-asb2364/irq-fpga.c +++ b/arch/mn10300/unit-asb2364/irq-fpga.c | |||
@@ -88,6 +88,17 @@ void __init irq_fpga_init(void) | |||
88 | { | 88 | { |
89 | int irq; | 89 | int irq; |
90 | 90 | ||
91 | ASB2364_FPGA_REG_MASK_LAN = 0x0001; | ||
92 | SyncExBus(); | ||
93 | ASB2364_FPGA_REG_MASK_UART = 0x0001; | ||
94 | SyncExBus(); | ||
95 | ASB2364_FPGA_REG_MASK_I2C = 0x0001; | ||
96 | SyncExBus(); | ||
97 | ASB2364_FPGA_REG_MASK_USB = 0x0001; | ||
98 | SyncExBus(); | ||
99 | ASB2364_FPGA_REG_MASK_FPGA = 0x0001; | ||
100 | SyncExBus(); | ||
101 | |||
91 | for (irq = NR_CPU_IRQS; irq < NR_IRQS; irq++) | 102 | for (irq = NR_CPU_IRQS; irq < NR_IRQS; irq++) |
92 | set_irq_chip_and_handler(irq, &asb2364_fpga_pic, handle_level_irq); | 103 | set_irq_chip_and_handler(irq, &asb2364_fpga_pic, handle_level_irq); |
93 | 104 | ||
diff --git a/arch/mn10300/unit-asb2364/unit-init.c b/arch/mn10300/unit-asb2364/unit-init.c index 11440803db10..6359b41ce7e9 100644 --- a/arch/mn10300/unit-asb2364/unit-init.c +++ b/arch/mn10300/unit-asb2364/unit-init.c | |||
@@ -20,13 +20,41 @@ | |||
20 | #include <asm/processor.h> | 20 | #include <asm/processor.h> |
21 | #include <asm/irq.h> | 21 | #include <asm/irq.h> |
22 | #include <asm/intctl-regs.h> | 22 | #include <asm/intctl-regs.h> |
23 | #include <asm/serial-regs.h> | ||
23 | #include <unit/fpga-regs.h> | 24 | #include <unit/fpga-regs.h> |
25 | #include <unit/serial.h> | ||
26 | #include <unit/smsc911x.h> | ||
27 | |||
28 | #define TTYS0_SERIAL_IER __SYSREG(SERIAL_PORT0_BASE_ADDRESS + UART_IER * 2, u8) | ||
29 | #define LAN_IRQ_CFG __SYSREG(SMSC911X_BASE + 0x54, u32) | ||
30 | #define LAN_INT_EN __SYSREG(SMSC911X_BASE + 0x5c, u32) | ||
24 | 31 | ||
25 | /* | 32 | /* |
26 | * initialise some of the unit hardware before gdbstub is set up | 33 | * initialise some of the unit hardware before gdbstub is set up |
27 | */ | 34 | */ |
28 | asmlinkage void __init unit_init(void) | 35 | asmlinkage void __init unit_init(void) |
29 | { | 36 | { |
37 | /* Make sure we aren't going to get unexpected interrupts */ | ||
38 | TTYS0_SERIAL_IER = 0; | ||
39 | SC0RXICR = 0; | ||
40 | SC0TXICR = 0; | ||
41 | SC1RXICR = 0; | ||
42 | SC1TXICR = 0; | ||
43 | SC2RXICR = 0; | ||
44 | SC2TXICR = 0; | ||
45 | |||
46 | /* Attempt to reset the FPGA attached peripherals */ | ||
47 | ASB2364_FPGA_REG_RESET_LAN = 0x0000; | ||
48 | SyncExBus(); | ||
49 | ASB2364_FPGA_REG_RESET_UART = 0x0000; | ||
50 | SyncExBus(); | ||
51 | ASB2364_FPGA_REG_RESET_I2C = 0x0000; | ||
52 | SyncExBus(); | ||
53 | ASB2364_FPGA_REG_RESET_USB = 0x0000; | ||
54 | SyncExBus(); | ||
55 | ASB2364_FPGA_REG_RESET_AV = 0x0000; | ||
56 | SyncExBus(); | ||
57 | |||
30 | /* set up the external interrupts */ | 58 | /* set up the external interrupts */ |
31 | 59 | ||
32 | /* XIRQ[0]: NAND RXBY */ | 60 | /* XIRQ[0]: NAND RXBY */ |
@@ -56,7 +84,23 @@ asmlinkage void __init unit_init(void) | |||
56 | */ | 84 | */ |
57 | asmlinkage void __init unit_setup(void) | 85 | asmlinkage void __init unit_setup(void) |
58 | { | 86 | { |
87 | /* Release the reset on the SMSC911X so that it is ready by the time we | ||
88 | * need it */ | ||
89 | ASB2364_FPGA_REG_RESET_LAN = 0x0001; | ||
90 | SyncExBus(); | ||
91 | ASB2364_FPGA_REG_RESET_UART = 0x0001; | ||
92 | SyncExBus(); | ||
93 | ASB2364_FPGA_REG_RESET_I2C = 0x0001; | ||
94 | SyncExBus(); | ||
95 | ASB2364_FPGA_REG_RESET_USB = 0x0001; | ||
96 | SyncExBus(); | ||
97 | ASB2364_FPGA_REG_RESET_AV = 0x0001; | ||
98 | SyncExBus(); | ||
59 | 99 | ||
100 | /* Make sure the ethernet chipset isn't going to give us an interrupt | ||
101 | * storm from stuff it was doing pre-reset */ | ||
102 | LAN_IRQ_CFG = 0; | ||
103 | LAN_INT_EN = 0; | ||
60 | } | 104 | } |
61 | 105 | ||
62 | /* | 106 | /* |