-
Notifications
You must be signed in to change notification settings - Fork 1
/
avga3000.diff
117 lines (110 loc) · 4.17 KB
/
avga3000.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
--- a/drivers/gpu/drm/radeon/atom.c
+++ b/drivers/gpu/drm/radeon/atom.c
@@ -1284,13 +1284,16 @@ struct atom_context *atom_parse(struct card_info *card, void *bios)
kfree(ctx);
return NULL;
}
- if (strncmp
- (CSTR(ATOM_ATI_MAGIC_PTR), ATOM_ATI_MAGIC,
- strlen(ATOM_ATI_MAGIC))) {
- printk(KERN_INFO "Invalid ATI magic.\n");
- kfree(ctx);
- return NULL;
- }
+ if (strncmp
+ (CSTR(ATOM_ATI_MAGIC_PTR), ATOM_ATI_MAGIC,
+ strlen(ATOM_ATI_MAGIC)) &&
+ strncmp
+ (CSTR(ATOM_ATI_MAGIC_PTR), ATOM_AVGA_MAGIC,
+ strlen(ATOM_AVGA_MAGIC))) {
+ printk(KERN_INFO "Invalid ATI magic.\n");
+ kfree(ctx);
+ return NULL;
+ }
base = CU16(ATOM_ROM_TABLE_PTR);
if (strncmp
--- a/drivers/gpu/drm/radeon/atom.h
+++ b/drivers/gpu/drm/radeon/atom.h
@@ -31,6 +31,7 @@
#define ATOM_BIOS_MAGIC 0xAA55
#define ATOM_ATI_MAGIC_PTR 0x30
#define ATOM_ATI_MAGIC " 761295520"
+#define ATOM_AVGA_MAGIC " 618573322"
#define ATOM_ROM_TABLE_PTR 0x48
#define ATOM_ROM_MAGIC "ATOM"
--- a/drivers/gpu/drm/radeon/radeon_atombios.c
+++ b/drivers/gpu/drm/radeon/radeon_atombios.c
@@ -341,6 +341,17 @@ static bool radeon_atom_apply_quirks(struct drm_device *dev,
return false;
}
+ /* Arcade VGA 3000 card is DVI+VGA, not DVI+DVI */
+ if ((dev->pdev->device == 0x958f) &&
+ (dev->pdev->subsystem_vendor == 0x1002) &&
+ (dev->pdev->subsystem_device == 0x0502)) {
+ if (supported_device == ATOM_DEVICE_CRT1_SUPPORT || supported_device == ATOM_DEVICE_DFP2_SUPPORT) {
+ if (*connector_type == DRM_MODE_CONNECTOR_DVII) {
+ *connector_type = DRM_MODE_CONNECTOR_VGA;
+ }
+ }
+ }
+
/* Gigabyte X1300 is DVI+VGA, not DVI+DVI */
if ((dev->pdev->device == 0x7142) &&
(dev->pdev->subsystem_vendor == 0x1458) &&
@@ -1165,6 +1176,14 @@ bool radeon_atom_get_clock_info(struct drm_device *dev)
p1pll->pll_out_max =
le32_to_cpu(firmware_info->info.ulMaxPixelClockPLL_Output);
+ /* Arcade VGA 3000 card settings */
+ if ((dev->pdev->device == 0x958f) &&
+ (dev->pdev->subsystem_vendor == 0x1002) &&
+ (dev->pdev->subsystem_device == 0x0502)) {
+ p1pll->pll_out_min = 50000;
+ p2pll->pll_out_min = 50000;
+ }
+
if (((frev < 2) && (crev >= 4)) || (frev >= 2)) {
p1pll->lcd_pll_out_min =
le16_to_cpu(firmware_info->info_14.usLcdMinPixelClockPLL_Output) * 100;
--- a/drivers/gpu/drm/radeon/radeon_bios.c
+++ b/drivers/gpu/drm/radeon/radeon_bios.c
@@ -30,6 +30,8 @@
#include "radeon.h"
#include "atom.h"
+#include <linux/firmware.h>
+#include <linux/module.h>
#include <linux/slab.h>
#include <linux/acpi.h>
/*
@@ -656,10 +658,32 @@ static inline bool radeon_acpi_vfct_bios(struct radeon_device *rdev)
bool radeon_get_bios(struct radeon_device *rdev)
{
- bool r;
+ bool r = false;
uint16_t tmp;
- r = radeon_atrm_get_bios(rdev);
+ /* AVGA 3000 Bios replacement */
+ if (rdev->family >= CHIP_R600) {
+ if ((rdev->pdev->device == 0x958f) &&
+ (rdev->pdev->subsystem_vendor == 0x1002) &&
+ (rdev->pdev->subsystem_device == 0x0502)) {
+ const struct firmware *fw_bios;
+ MODULE_FIRMWARE("radeon/hd2600.bin");
+
+ printk("ArcadeVGA 3000 board found\n");
+ if (!request_firmware(&fw_bios, "radeon/hd2600.bin", &rdev->pdev->dev)) {
+ if (fw_bios->size > 0) {
+ printk("AVGA 3000 board using hd2600 vbios of %d bytes\n", (int)fw_bios->size);
+ rdev->bios = kmemdup(fw_bios->data, fw_bios->size, GFP_KERNEL);
+ if (rdev->bios)
+ r = true;
+ }
+ release_firmware(fw_bios);
+ }
+ }
+ }
+
+ if (r == false)
+ r = radeon_atrm_get_bios(rdev);
if (r == false)
r = radeon_acpi_vfct_bios(rdev);
if (r == false)