diff options
author | Thomas Bogendoerfer <tsbogend@alpha.franken.de> | 2007-05-17 08:53:12 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2007-06-06 14:34:31 -0400 |
commit | 22df5bc591ea2d0dbe8240fe8af0816b8a6533b9 (patch) | |
tree | e933d8fb44a0ab21f7775db121e647f0dbf9a60b /arch | |
parent | 0c2bf745f9bdef7243ef5f04e6b05f592abead06 (diff) |
[MIPS] Fix VGA corruption on RM300C
... by setting DRAM config to 2MB (SNI always used that size). This also
fixes video dram size detection in cirrusfb.
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/mips/sni/setup.c | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/arch/mips/sni/setup.c b/arch/mips/sni/setup.c index 68d7cf609b4f..4fedfbda0c79 100644 --- a/arch/mips/sni/setup.c +++ b/arch/mips/sni/setup.c | |||
@@ -6,7 +6,7 @@ | |||
6 | * for more details. | 6 | * for more details. |
7 | * | 7 | * |
8 | * Copyright (C) 1996, 97, 98, 2000, 03, 04, 06 Ralf Baechle (ralf@linux-mips.org) | 8 | * Copyright (C) 1996, 97, 98, 2000, 03, 04, 06 Ralf Baechle (ralf@linux-mips.org) |
9 | * Copyright (C) 2006 Thomas Bogendoerfer (tsbogend@alpha.franken.de) | 9 | * Copyright (C) 2006,2007 Thomas Bogendoerfer (tsbogend@alpha.franken.de) |
10 | */ | 10 | */ |
11 | #include <linux/eisa.h> | 11 | #include <linux/eisa.h> |
12 | #include <linux/init.h> | 12 | #include <linux/init.h> |
@@ -92,3 +92,34 @@ void __init plat_mem_setup(void) | |||
92 | 92 | ||
93 | sni_display_setup(); | 93 | sni_display_setup(); |
94 | } | 94 | } |
95 | |||
96 | #if CONFIG_PCI | ||
97 | |||
98 | #include <linux/pci.h> | ||
99 | #include <video/vga.h> | ||
100 | #include <video/cirrus.h> | ||
101 | |||
102 | static void __devinit quirk_cirrus_ram_size(struct pci_dev *dev) | ||
103 | { | ||
104 | u16 cmd; | ||
105 | |||
106 | /* | ||
107 | * firmware doesn't set the ram size correct, so we | ||
108 | * need to do it here, otherwise we get screen corruption | ||
109 | * on older Cirrus chips | ||
110 | */ | ||
111 | pci_read_config_word (dev, PCI_COMMAND, &cmd); | ||
112 | if ((cmd & (PCI_COMMAND_IO|PCI_COMMAND_MEMORY)) | ||
113 | == (PCI_COMMAND_IO|PCI_COMMAND_MEMORY)) { | ||
114 | vga_wseq (NULL, CL_SEQR6, 0x12); /* unlock all extension registers */ | ||
115 | vga_wseq (NULL, CL_SEQRF, 0x18); | ||
116 | } | ||
117 | } | ||
118 | |||
119 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_CIRRUS, PCI_DEVICE_ID_CIRRUS_5434_8, | ||
120 | quirk_cirrus_ram_size); | ||
121 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_CIRRUS, PCI_DEVICE_ID_CIRRUS_5436, | ||
122 | quirk_cirrus_ram_size); | ||
123 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_CIRRUS, PCI_DEVICE_ID_CIRRUS_5446, | ||
124 | quirk_cirrus_ram_size); | ||
125 | #endif | ||