aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorPaul Burton <paul.burton@imgtec.com>2013-12-02 11:48:37 -0500
committerRalf Baechle <ralf@linux-mips.org>2014-01-23 07:02:35 -0500
commitae0d7cbc99890b3a417a5705763784b8551a10d6 (patch)
tree5cad4268f616744749f6ea23e5ce406ecd2aec35 /arch
parenta87ea88d8f6c7ce5551b3761f8db5a4341c8b25d (diff)
MIPS: Malta: mux & enable SERIRQ interrupt
This patch causes the kernel to mux the SERIRQ interrupt to the SERIRQ pin of the PIIX4 and to enable that interrupt. The kernel depends upon the interrupt when using the SuperIO UARTs (ttyS0 & ttyS1) but previously would not configure it, instead relying upon the bootloader having done so. If that is not the case then the typical result is that the system appears to hang once it reaches userland as no output is displayed on the UART. Signed-off-by: Paul Burton <paul.burton@imgtec.com> Reviewed-by: Markos Chandras <markos.chandras@imgtec.com> Signed-off-by: John Crispin <blogic@openwrt.org> Patchwork: http://patchwork.linux-mips.org/patch/6182/
Diffstat (limited to 'arch')
-rw-r--r--arch/mips/include/asm/mips-boards/piix4.h7
-rw-r--r--arch/mips/pci/fixup-malta.c11
2 files changed, 18 insertions, 0 deletions
diff --git a/arch/mips/include/asm/mips-boards/piix4.h b/arch/mips/include/asm/mips-boards/piix4.h
index e33227998713..836e2ede24de 100644
--- a/arch/mips/include/asm/mips-boards/piix4.h
+++ b/arch/mips/include/asm/mips-boards/piix4.h
@@ -26,6 +26,10 @@
26#define PIIX4_FUNC0_PIRQRC_IRQ_ROUTING_DISABLE (1 << 7) 26#define PIIX4_FUNC0_PIRQRC_IRQ_ROUTING_DISABLE (1 << 7)
27#define PIIX4_FUNC0_PIRQRC_IRQ_ROUTING_MASK 0xf 27#define PIIX4_FUNC0_PIRQRC_IRQ_ROUTING_MASK 0xf
28#define PIIX4_FUNC0_PIRQRC_IRQ_ROUTING_MAX 16 28#define PIIX4_FUNC0_PIRQRC_IRQ_ROUTING_MAX 16
29/* SERIRQ Control */
30#define PIIX4_FUNC0_SERIRQC 0x64
31#define PIIX4_FUNC0_SERIRQC_EN (1 << 7)
32#define PIIX4_FUNC0_SERIRQC_CONT (1 << 6)
29/* Top Of Memory */ 33/* Top Of Memory */
30#define PIIX4_FUNC0_TOM 0x69 34#define PIIX4_FUNC0_TOM 0x69
31#define PIIX4_FUNC0_TOM_TOP_OF_MEMORY_MASK 0xf0 35#define PIIX4_FUNC0_TOM_TOP_OF_MEMORY_MASK 0xf0
@@ -34,6 +38,9 @@
34#define PIIX4_FUNC0_DLC_USBPR_EN (1 << 2) 38#define PIIX4_FUNC0_DLC_USBPR_EN (1 << 2)
35#define PIIX4_FUNC0_DLC_PASSIVE_RELEASE_EN (1 << 1) 39#define PIIX4_FUNC0_DLC_PASSIVE_RELEASE_EN (1 << 1)
36#define PIIX4_FUNC0_DLC_DELAYED_TRANSACTION_EN (1 << 0) 40#define PIIX4_FUNC0_DLC_DELAYED_TRANSACTION_EN (1 << 0)
41/* General Configuration */
42#define PIIX4_FUNC0_GENCFG 0xb0
43#define PIIX4_FUNC0_GENCFG_SERIRQ (1 << 16)
37 44
38/* IDE Timing */ 45/* IDE Timing */
39#define PIIX4_FUNC1_IDETIM_PRIMARY_LO 0x40 46#define PIIX4_FUNC1_IDETIM_PRIMARY_LO 0x40
diff --git a/arch/mips/pci/fixup-malta.c b/arch/mips/pci/fixup-malta.c
index df36e2327c54..7a0eda782e35 100644
--- a/arch/mips/pci/fixup-malta.c
+++ b/arch/mips/pci/fixup-malta.c
@@ -54,6 +54,7 @@ int pcibios_plat_dev_init(struct pci_dev *dev)
54static void malta_piix_func0_fixup(struct pci_dev *pdev) 54static void malta_piix_func0_fixup(struct pci_dev *pdev)
55{ 55{
56 unsigned char reg_val; 56 unsigned char reg_val;
57 u32 reg_val32;
57 /* PIIX PIRQC[A:D] irq mappings */ 58 /* PIIX PIRQC[A:D] irq mappings */
58 static int piixirqmap[PIIX4_FUNC0_PIRQRC_IRQ_ROUTING_MAX] = { 59 static int piixirqmap[PIIX4_FUNC0_PIRQRC_IRQ_ROUTING_MAX] = {
59 0, 0, 0, 3, 60 0, 0, 0, 3,
@@ -83,6 +84,16 @@ static void malta_piix_func0_fixup(struct pci_dev *pdev)
83 pci_write_config_byte(pdev, PIIX4_FUNC0_TOM, reg_val | 84 pci_write_config_byte(pdev, PIIX4_FUNC0_TOM, reg_val |
84 PIIX4_FUNC0_TOM_TOP_OF_MEMORY_MASK); 85 PIIX4_FUNC0_TOM_TOP_OF_MEMORY_MASK);
85 } 86 }
87
88 /* Mux SERIRQ to its pin */
89 pci_read_config_dword(pdev, PIIX4_FUNC0_GENCFG, &reg_val32);
90 pci_write_config_dword(pdev, PIIX4_FUNC0_GENCFG,
91 reg_val32 | PIIX4_FUNC0_GENCFG_SERIRQ);
92
93 /* Enable SERIRQ */
94 pci_read_config_byte(pdev, PIIX4_FUNC0_SERIRQC, &reg_val);
95 reg_val |= PIIX4_FUNC0_SERIRQC_EN | PIIX4_FUNC0_SERIRQC_CONT;
96 pci_write_config_byte(pdev, PIIX4_FUNC0_SERIRQC, reg_val);
86} 97}
87 98
88DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371AB_0, 99DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371AB_0,