aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2012-12-06 00:44:23 -0500
committerBen Skeggs <bskeggs@redhat.com>2013-02-20 01:00:27 -0500
commit230881821a4467727f4100b5ee5c3ef0b67f3128 (patch)
tree086dea3525ba495d87bc66f0ca14e8ac737cd7aa /drivers/gpu/drm
parente84e4b67ddd6fcbfe5ab39c7aed1d490a8c6283c (diff)
drm/nouveau: remove some more unnecessary legacy bios code
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_bios.c59
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_bios.h12
2 files changed, 5 insertions, 66 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_bios.c b/drivers/gpu/drm/nouveau/nouveau_bios.c
index 9a69e0b131bf..5e1cfcacb140 100644
--- a/drivers/gpu/drm/nouveau/nouveau_bios.c
+++ b/drivers/gpu/drm/nouveau/nouveau_bios.c
@@ -678,23 +678,6 @@ int run_tmds_table(struct drm_device *dev, struct dcb_output *dcbent, int head,
678 return 0; 678 return 0;
679} 679}
680 680
681static void parse_bios_version(struct drm_device *dev, struct nvbios *bios, uint16_t offset)
682{
683 /*
684 * offset + 0 (8 bits): Micro version
685 * offset + 1 (8 bits): Minor version
686 * offset + 2 (8 bits): Chip version
687 * offset + 3 (8 bits): Major version
688 */
689 struct nouveau_drm *drm = nouveau_drm(dev);
690
691 bios->major_version = bios->data[offset + 3];
692 bios->chip_version = bios->data[offset + 2];
693 NV_INFO(drm, "Bios version %02x.%02x.%02x.%02x\n",
694 bios->data[offset + 3], bios->data[offset + 2],
695 bios->data[offset + 1], bios->data[offset]);
696}
697
698static void parse_script_table_pointers(struct nvbios *bios, uint16_t offset) 681static void parse_script_table_pointers(struct nvbios *bios, uint16_t offset)
699{ 682{
700 /* 683 /*
@@ -710,12 +693,6 @@ static void parse_script_table_pointers(struct nvbios *bios, uint16_t offset)
710 */ 693 */
711 694
712 bios->init_script_tbls_ptr = ROM16(bios->data[offset]); 695 bios->init_script_tbls_ptr = ROM16(bios->data[offset]);
713 bios->macro_index_tbl_ptr = ROM16(bios->data[offset + 2]);
714 bios->macro_tbl_ptr = ROM16(bios->data[offset + 4]);
715 bios->condition_tbl_ptr = ROM16(bios->data[offset + 6]);
716 bios->io_condition_tbl_ptr = ROM16(bios->data[offset + 8]);
717 bios->io_flag_condition_tbl_ptr = ROM16(bios->data[offset + 10]);
718 bios->init_function_tbl_ptr = ROM16(bios->data[offset + 12]);
719} 696}
720 697
721static int parse_bit_A_tbl_entry(struct drm_device *dev, struct nvbios *bios, struct bit_entry *bitentry) 698static int parse_bit_A_tbl_entry(struct drm_device *dev, struct nvbios *bios, struct bit_entry *bitentry)
@@ -765,25 +742,6 @@ static int parse_bit_A_tbl_entry(struct drm_device *dev, struct nvbios *bios, st
765 return 0; 742 return 0;
766} 743}
767 744
768static int parse_bit_C_tbl_entry(struct drm_device *dev, struct nvbios *bios, struct bit_entry *bitentry)
769{
770 /*
771 * offset + 8 (16 bits): PLL limits table pointer
772 *
773 * There's more in here, but that's unknown.
774 */
775 struct nouveau_drm *drm = nouveau_drm(dev);
776
777 if (bitentry->length < 10) {
778 NV_ERROR(drm, "Do not understand BIT C table\n");
779 return -EINVAL;
780 }
781
782 bios->pll_limit_tbl_ptr = ROM16(bios->data[bitentry->offset + 8]);
783
784 return 0;
785}
786
787static int parse_bit_display_tbl_entry(struct drm_device *dev, struct nvbios *bios, struct bit_entry *bitentry) 745static int parse_bit_display_tbl_entry(struct drm_device *dev, struct nvbios *bios, struct bit_entry *bitentry)
788{ 746{
789 /* 747 /*
@@ -821,12 +779,6 @@ static int parse_bit_init_tbl_entry(struct drm_device *dev, struct nvbios *bios,
821 } 779 }
822 780
823 parse_script_table_pointers(bios, bitentry->offset); 781 parse_script_table_pointers(bios, bitentry->offset);
824
825 if (bitentry->length >= 16)
826 bios->some_script_ptr = ROM16(bios->data[bitentry->offset + 14]);
827 if (bitentry->length >= 18)
828 bios->init96_tbl_ptr = ROM16(bios->data[bitentry->offset + 16]);
829
830 return 0; 782 return 0;
831} 783}
832 784
@@ -852,8 +804,6 @@ static int parse_bit_i_tbl_entry(struct drm_device *dev, struct nvbios *bios, st
852 return -EINVAL; 804 return -EINVAL;
853 } 805 }
854 806
855 parse_bios_version(dev, bios, bitentry->offset);
856
857 /* 807 /*
858 * bit 4 seems to indicate a mobile bios (doesn't suffer from BMP's 808 * bit 4 seems to indicate a mobile bios (doesn't suffer from BMP's
859 * Quadro identity crisis), other bits possibly as for BMP feature byte 809 * Quadro identity crisis), other bits possibly as for BMP feature byte
@@ -1078,9 +1028,6 @@ parse_bit_structure(struct nvbios *bios, const uint16_t bitoffset)
1078 return ret; 1028 return ret;
1079 if (bios->major_version >= 0x60) /* g80+ */ 1029 if (bios->major_version >= 0x60) /* g80+ */
1080 parse_bit_table(bios, bitoffset, &BIT_TABLE('A', A)); 1030 parse_bit_table(bios, bitoffset, &BIT_TABLE('A', A));
1081 ret = parse_bit_table(bios, bitoffset, &BIT_TABLE('C', C));
1082 if (ret)
1083 return ret;
1084 parse_bit_table(bios, bitoffset, &BIT_TABLE('D', display)); 1031 parse_bit_table(bios, bitoffset, &BIT_TABLE('D', display));
1085 ret = parse_bit_table(bios, bitoffset, &BIT_TABLE('I', init)); 1032 ret = parse_bit_table(bios, bitoffset, &BIT_TABLE('I', init));
1086 if (ret) 1033 if (ret)
@@ -1228,8 +1175,6 @@ static int parse_bmp_structure(struct drm_device *dev, struct nvbios *bios, unsi
1228 */ 1175 */
1229 bios->feature_byte = bmp[9]; 1176 bios->feature_byte = bmp[9];
1230 1177
1231 parse_bios_version(dev, bios, offset + 10);
1232
1233 if (bmp_version_major < 5 || bmp_version_minor < 0x10) 1178 if (bmp_version_major < 5 || bmp_version_minor < 0x10)
1234 bios->old_style_init = true; 1179 bios->old_style_init = true;
1235 legacy_scripts_offset = 18; 1180 legacy_scripts_offset = 18;
@@ -1276,8 +1221,10 @@ static int parse_bmp_structure(struct drm_device *dev, struct nvbios *bios, unsi
1276 bios->fp.lvdsmanufacturerpointer = ROM16(bmp[117]); 1221 bios->fp.lvdsmanufacturerpointer = ROM16(bmp[117]);
1277 bios->fp.fpxlatemanufacturertableptr = ROM16(bmp[119]); 1222 bios->fp.fpxlatemanufacturertableptr = ROM16(bmp[119]);
1278 } 1223 }
1224#if 0
1279 if (bmplength > 143) 1225 if (bmplength > 143)
1280 bios->pll_limit_tbl_ptr = ROM16(bmp[142]); 1226 bios->pll_limit_tbl_ptr = ROM16(bmp[142]);
1227#endif
1281 1228
1282 if (bmplength > 157) 1229 if (bmplength > 157)
1283 bios->fp.duallink_transition_clk = ROM16(bmp[156]) * 10; 1230 bios->fp.duallink_transition_clk = ROM16(bmp[156]) * 10;
@@ -2072,6 +2019,8 @@ static bool NVInitVBIOS(struct drm_device *dev)
2072 return !parse_bmp_structure(dev, legacy, legacy->offset); 2019 return !parse_bmp_structure(dev, legacy, legacy->offset);
2073 } 2020 }
2074 2021
2022 legacy->major_version = bios->version.major;
2023 legacy->chip_version = bios->version.chip;
2075 return false; 2024 return false;
2076} 2025}
2077 2026
diff --git a/drivers/gpu/drm/nouveau/nouveau_bios.h b/drivers/gpu/drm/nouveau/nouveau_bios.h
index f68c54ca422f..7ccd28f11adf 100644
--- a/drivers/gpu/drm/nouveau/nouveau_bios.h
+++ b/drivers/gpu/drm/nouveau/nouveau_bios.h
@@ -107,20 +107,10 @@ struct nvbios {
107 bool old_style_init; 107 bool old_style_init;
108 uint16_t init_script_tbls_ptr; 108 uint16_t init_script_tbls_ptr;
109 uint16_t extra_init_script_tbl_ptr; 109 uint16_t extra_init_script_tbl_ptr;
110 uint16_t macro_index_tbl_ptr; 110
111 uint16_t macro_tbl_ptr;
112 uint16_t condition_tbl_ptr;
113 uint16_t io_condition_tbl_ptr;
114 uint16_t io_flag_condition_tbl_ptr;
115 uint16_t init_function_tbl_ptr;
116
117 uint16_t pll_limit_tbl_ptr;
118 uint16_t ram_restrict_tbl_ptr; 111 uint16_t ram_restrict_tbl_ptr;
119 uint8_t ram_restrict_group_count; 112 uint8_t ram_restrict_group_count;
120 113
121 uint16_t some_script_ptr; /* BIT I + 14 */
122 uint16_t init96_tbl_ptr; /* BIT I + 16 */
123
124 struct dcb_table dcb; 114 struct dcb_table dcb;
125 115
126 struct { 116 struct {