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