2 * This file is part of the coreboot project.
4 * Copyright (C) 2008 Advanced Micro Devices, Inc.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21 * for rs690 internal graphics device
22 * device id of internal grphics:
26 #include <console/console.h>
27 #include <device/device.h>
28 #include <device/pci.h>
29 #include <device/pci_ids.h>
30 #include <device/pci_ops.h>
34 #define CLK_CNTL_INDEX 0x8
35 #define CLK_CNTL_DATA 0xC
37 static u32 clkind_read(device_t dev, u32 index)
39 u32 gfx_bar2 = pci_read_config32(dev, 0x18) & ~0xF;
41 *(u32*)(gfx_bar2+CLK_CNTL_INDEX) = index & 0x7F;
42 return *(u32*)(gfx_bar2+CLK_CNTL_DATA);
45 static void clkind_write(device_t dev, u32 index, u32 data)
47 u32 gfx_bar2 = pci_read_config32(dev, 0x18) & ~0xF;
48 /* printk(BIOS_INFO, "gfx bar 2 %02x\n", gfx_bar2); */
50 *(u32*)(gfx_bar2+CLK_CNTL_INDEX) = index | 1<<7;
51 *(u32*)(gfx_bar2+CLK_CNTL_DATA) = data;
55 * pci_dev_read_resources thinks it is a IO type.
56 * We have to force it to mem type.
58 static void rs690_gfx_read_resources(device_t dev)
60 printk(BIOS_INFO, "rs690_gfx_read_resources.\n");
62 /* The initial value of 0x24 is 0xFFFFFFFF, which is confusing.
63 Even if we write 0xFFFFFFFF into it, it will be 0xFFF00000,
64 which tells us it is a memory address base.
66 pci_write_config32(dev, 0x24, 0x00000000);
68 /* Get the normal pci resources of this device */
69 pci_dev_read_resources(dev);
70 compact_resources(dev);
73 static void internal_gfx_pci_dev_init(struct device *dev)
75 u16 deviceid, vendorid;
76 struct southbridge_amd_rs690_config *cfg =
77 (struct southbridge_amd_rs690_config *)dev->chip_info;
78 deviceid = pci_read_config16(dev, PCI_DEVICE_ID);
79 vendorid = pci_read_config16(dev, PCI_VENDOR_ID);
80 printk(BIOS_INFO, "internal_gfx_pci_dev_init device=%x, vendor=%x.\n",
86 clkind_write(dev, 0x08, 0x01);
87 clkind_write(dev, 0x0C, 0x22);
88 clkind_write(dev, 0x0F, 0x0);
89 clkind_write(dev, 0x11, 0x0);
90 clkind_write(dev, 0x12, 0x0);
91 clkind_write(dev, 0x14, 0x0);
92 clkind_write(dev, 0x15, 0x0);
93 clkind_write(dev, 0x16, 0x0);
94 clkind_write(dev, 0x17, 0x0);
95 clkind_write(dev, 0x18, 0x0);
96 clkind_write(dev, 0x19, 0x0);
97 clkind_write(dev, 0x1A, 0x0);
98 clkind_write(dev, 0x1B, 0x0);
99 clkind_write(dev, 0x1C, 0x0);
100 clkind_write(dev, 0x1D, 0x0);
101 clkind_write(dev, 0x1E, 0x0);
102 clkind_write(dev, 0x26, 0x0);
103 clkind_write(dev, 0x27, 0x0);
104 clkind_write(dev, 0x28, 0x0);
105 clkind_write(dev, 0x5C, 0x0);
110 * Set registers in RS690 and CPU to enable the internal GFX.
111 * Please refer to CIM source code and BKDG.
113 static void rs690_internal_gfx_enable(device_t dev)
117 device_t k8_f0 = 0, k8_f2 = 0;
118 device_t nb_dev = dev_find_slot(0, 0);
120 printk(BIOS_INFO, "rs690_internal_gfx_enable dev=0x%p, nb_dev=0x%p.\n", dev,
123 /* set APERTURE_SIZE, 128M. */
124 l_dword = pci_read_config32(nb_dev, 0x8c);
125 printk(BIOS_INFO, "nb_dev, 0x8c=0x%x\n", l_dword);
126 l_dword &= 0xffffff8f;
127 pci_write_config32(nb_dev, 0x8c, l_dword);
130 rs690_set_tom(nb_dev);
132 /* LPC DMA Deadlock workaround? */
133 k8_f0 = dev_find_slot(0, PCI_DEVFN(0x18, 0));
134 l_dword = pci_read_config32(k8_f0, 0x68);
135 l_dword &= ~(1 << 22);
136 l_dword |= (1 << 21);
137 pci_write_config32(k8_f0, 0x68, l_dword);
139 /* Enable 64bit mode. */
140 set_nbmc_enable_bits(nb_dev, 0x5f, 0, 1 << 9);
141 set_nbmc_enable_bits(nb_dev, 0xb0, 0, 1 << 8);
144 set_nbmc_enable_bits(nb_dev, 0x5f, 0x7c00, 0x800);
146 /* UMA dual channel control register. */
147 nbmc_write_index(nb_dev, 0x86, 0x3d);
149 /* check the setting later!! */
150 set_htiu_enable_bits(nb_dev, 0x07, 1 << 7, 0);
152 /* UMA mode, powerdown memory PLL. */
153 set_nbmc_enable_bits(nb_dev, 0x74, 0, 1 << 31);
155 /* Copy CPU DDR Controller to NB MC. */
156 /* Why K8_MC_REG80 is special? */
157 k8_f2 = dev_find_slot(0, PCI_DEVFN(0x18, 2));
158 for (i = 0; i <= (0x80 - 0x40) / 4; i++) {
159 l_dword = pci_read_config32(k8_f2, 0x40 + i * 4);
160 nbmc_write_index(nb_dev, 0x63 + i, l_dword);
163 /* Set K8 MC for UMA, Family F. */
164 l_dword = pci_read_config32(k8_f2, 0xa0);
166 pci_write_config32(k8_f2, 0xa0, l_dword);
167 l_dword = pci_read_config32(k8_f2, 0x94);
168 l_dword &= 0xf0ffffff;
169 l_dword |= 0x07000000;
170 pci_write_config32(k8_f2, 0x94, l_dword);
172 /* set FB size and location. */
173 nbmc_write_index(nb_dev, 0x1b, 0x00);
174 l_dword = nbmc_read_index(nb_dev, 0x1c);
176 l_dword |= 0x400 << 20;
178 nbmc_write_index(nb_dev, 0x1c, l_dword);
179 l_dword = nbmc_read_index(nb_dev, 0x1d);
180 l_dword &= 0xfffff000;
182 nbmc_write_index(nb_dev, 0x1d, l_dword);
183 nbmc_write_index(nb_dev, 0x100, 0x3fff3800);
185 /* Program MC table. */
186 set_nbmc_enable_bits(nb_dev, 0x00, 0, 1 << 31);
187 l_dword = nbmc_read_index(nb_dev, 0x91);
189 nbmc_write_index(nb_dev, 0x91, l_dword);
190 set_nbmc_enable_bits(nb_dev, 0xb1, 0, 1 << 6);
191 set_nbmc_enable_bits(nb_dev, 0xc3, 0, 1);
193 /* TODO: the optimization of voltage and frequency */
196 static struct pci_operations lops_pci = {
197 .set_subsystem = pci_dev_set_subsystem,
200 static struct device_operations pcie_ops = {
201 .read_resources = rs690_gfx_read_resources,
202 .set_resources = pci_dev_set_resources,
203 .enable_resources = pci_dev_enable_resources,
204 .init = internal_gfx_pci_dev_init, /* The option ROM initializes the device. rs690_gfx_init, */
206 .enable = rs690_internal_gfx_enable,
207 .ops_pci = &lops_pci,
211 * The dev id of 690G is 791E, while the id of 690M, 690T is 791F.
212 * We should list both of them here.
214 static const struct pci_driver pcie_driver_690t __pci_driver = {
216 .vendor = PCI_VENDOR_ID_ATI,
217 .device = PCI_DEVICE_ID_ATI_RS690MT_INT_GFX,
220 static const struct pci_driver pcie_driver_690 __pci_driver = {
222 .vendor = PCI_VENDOR_ID_ATI,
223 .device = PCI_DEVICE_ID_ATI_RS690_INT_GFX,
226 /* step 12 ~ step 14 from rpr */
227 static void single_port_configuration(device_t nb_dev, device_t dev)
231 struct southbridge_amd_rs690_config *cfg =
232 (struct southbridge_amd_rs690_config *)nb_dev->chip_info;
234 printk(BIOS_INFO, "rs690_gfx_init single_port_configuration.\n");
236 /* step 12 training, releases hold training for GFX port 0 (device 2) */
237 set_nbmisc_enable_bits(nb_dev, 0x8, 1 << 4, 0<<4);
238 PcieReleasePortTraining(nb_dev, dev, 2);
239 result = PcieTrainPort(nb_dev, dev, 2);
240 printk(BIOS_INFO, "rs690_gfx_init single_port_configuration step12.\n");
242 /* step 13 Power Down Control */
243 /* step 13.1 Enables powering down transmitter and receiver pads along with PLL macros. */
244 set_pcie_enable_bits(nb_dev, 0x40, 1 << 0, 1 << 0);
246 /* step 13.a Link Training was NOT successful */
248 set_nbmisc_enable_bits(nb_dev, 0x8, 0, 0x3 << 4); /* prevent from training. */
249 set_nbmisc_enable_bits(nb_dev, 0xc, 0, 0x3 << 2); /* hide the GFX bridge. */
251 nbpcie_ind_write_index(nb_dev, 0x65, 0xccf0f0);
253 nbpcie_ind_write_index(nb_dev, 0x65, 0xffffffff);
254 set_nbmisc_enable_bits(nb_dev, 0x7, 1 << 3, 1 << 3);
256 } else { /* step 13.b Link Training was successful */
258 reg32 = nbpcie_p_read_index(dev, 0xa2);
259 width = (reg32 >> 4) & 0x7;
260 printk(BIOS_DEBUG, "GFX LC_LINK_WIDTH = 0x%x.\n", width);
264 nbpcie_ind_write_index(nb_dev, 0x65,
265 cfg->gfx_lane_reversal ? 0x7f7f : 0xccfefe);
268 nbpcie_ind_write_index(nb_dev, 0x65,
269 cfg->gfx_lane_reversal ? 0x3f3f : 0xccfcfc);
272 nbpcie_ind_write_index(nb_dev, 0x65,
273 cfg->gfx_lane_reversal ? 0x0f0f : 0xccf0f0);
277 printk(BIOS_INFO, "rs690_gfx_init single_port_configuration step13.\n");
279 /* step 14 Reset Enumeration Timer, disables the shortening of the enumeration timer */
280 set_pcie_enable_bits(dev, 0x70, 1 << 19, 0 << 19);
281 printk(BIOS_INFO, "rs690_gfx_init single_port_configuration step14.\n");
284 /* step 15 ~ step 18 from rpr */
285 static void dual_port_configuration(device_t nb_dev, device_t dev)
289 struct southbridge_amd_rs690_config *cfg =
290 (struct southbridge_amd_rs690_config *)nb_dev->chip_info;
292 /* step 15: Training for Device 2 */
293 set_nbmisc_enable_bits(nb_dev, 0x8, 1 << 4, 0 << 4);
294 /* Releases hold training for GFX port 0 (device 2) */
295 PcieReleasePortTraining(nb_dev, dev, 2);
296 /* PCIE Link Training Sequence */
297 result = PcieTrainPort(nb_dev, dev, 2);
299 /* step 16: Power Down Control for Device 2 */
300 /* step 16.a Link Training was NOT successful */
302 /* Powers down all lanes for port A */
303 nbpcie_ind_write_index(nb_dev, 0x65, 0x0f0f);
304 } else { /* step 16.b Link Training was successful */
306 reg32 = nbpcie_p_read_index(dev, 0xa2);
307 width = (reg32 >> 4) & 0x7;
308 printk(BIOS_DEBUG, "GFX LC_LINK_WIDTH = 0x%x.\n", width);
312 nbpcie_ind_write_index(nb_dev, 0x65,
313 cfg->gfx_lane_reversal ? 0x0707 : 0x0e0e);
316 nbpcie_ind_write_index(nb_dev, 0x65,
317 cfg->gfx_lane_reversal ? 0x0303 : 0x0c0c);
322 /* step 17: Training for Device 3 */
323 set_nbmisc_enable_bits(nb_dev, 0x8, 1 << 5, 0 << 5);
324 /* Releases hold training for GFX port 0 (device 3) */
325 PcieReleasePortTraining(nb_dev, dev, 3);
326 /* PCIE Link Training Sequence */
327 result = PcieTrainPort(nb_dev, dev, 3);
329 /*step 18: Power Down Control for Device 3 */
330 /* step 18.a Link Training was NOT successful */
332 /* Powers down all lanes for port B and PLL1 */
333 nbpcie_ind_write_index(nb_dev, 0x65, 0xccf0f0);
334 } else { /* step 18.b Link Training was successful */
336 reg32 = nbpcie_p_read_index(dev, 0xa2);
337 width = (reg32 >> 4) & 0x7;
338 printk(BIOS_DEBUG, "GFX LC_LINK_WIDTH = 0x%x.\n", width);
342 nbpcie_ind_write_index(nb_dev, 0x65,
343 cfg->gfx_lane_reversal ? 0x7070 : 0xe0e0);
346 nbpcie_ind_write_index(nb_dev, 0x65,
347 cfg->gfx_lane_reversal ? 0x3030 : 0xc0c0);
354 /* For single port GFX configuration Only
361 * 101 = x12 (not supported)
364 static void dynamic_link_width_control(device_t nb_dev, device_t dev, u8 width)
368 struct southbridge_amd_rs690_config *cfg =
369 (struct southbridge_amd_rs690_config *)nb_dev->chip_info;
372 reg32 = nbpcie_p_read_index(dev, 0xa2);
375 set_pcie_enable_bits(nb_dev, 0x40, 1 << 0, 1 << 0);
377 set_pcie_enable_bits(dev, 0xa2, 3 << 0, width << 0);
379 set_pcie_enable_bits(dev, 0xa2, 1 << 8, 1 << 8);
381 if (0 == cfg->gfx_reconfiguration)
382 set_pcie_enable_bits(dev, 0xa2, 1 << 11, 1 << 11);
386 reg32 = nbpcie_p_read_index(dev, 0xa2);
388 while (reg32 & 0x100);
391 sb_dev = dev_find_slot(0, PCI_DEVFN(8, 0));
393 reg32 = pci_ext_read_config32(nb_dev, sb_dev,
394 PCIE_VC0_RESOURCE_STATUS);
395 } while (reg32 & VC_NEGOTIATION_PENDING);
398 reg32 = nbpcie_p_read_index(dev, 0xa2);
399 if (((reg32 & 0x70) >> 4) != 0x6) {
400 /* the unused lanes should be powered off. */
404 set_pcie_enable_bits(nb_dev, 0x40, 1 << 0, 0 << 0);
408 * GFX Core initialization, dev2, dev3
410 void rs690_gfx_init(device_t nb_dev, device_t dev, u32 port)
413 struct southbridge_amd_rs690_config *cfg =
414 (struct southbridge_amd_rs690_config *)nb_dev->chip_info;
416 printk(BIOS_INFO, "rs690_gfx_init, nb_dev=0x%p, dev=0x%p, port=0x%x.\n",
419 /* step 0, REFCLK_SEL, skip A11 revision */
420 set_nbmisc_enable_bits(nb_dev, 0x6a, 1 << 9,
421 cfg->gfx_dev2_dev3 ? 1 << 9 : 0 << 9);
422 printk(BIOS_INFO, "rs690_gfx_init step0.\n");
424 /* step 1, lane reversal (only need if CMOS option is enabled) */
425 if (cfg->gfx_lane_reversal) {
426 set_nbmisc_enable_bits(nb_dev, 0x33, 1 << 2, 1 << 2);
427 if (cfg->gfx_dual_slot)
428 set_nbmisc_enable_bits(nb_dev, 0x33, 1 << 3, 1 << 3);
430 printk(BIOS_INFO, "rs690_gfx_init step1.\n");
432 /* step 1.1, dual-slot gfx configuration (only need if CMOS option is enabled) */
433 /* AMD calls the configuration CrossFire */
434 if (cfg->gfx_dual_slot)
435 set_nbmisc_enable_bits(nb_dev, 0x0, 0xf << 8, 5 << 8);
436 printk(BIOS_INFO, "rs690_gfx_init step2.\n");
438 /* step 2, TMDS, (only need if CMOS option is enabled) */
442 /* step 3, GFX overclocking, (only need if CMOS option is enabled) */
445 /* step 4, reset the GFX link */
446 /* step 4.1 asserts both calibration reset and global reset */
447 set_nbmisc_enable_bits(nb_dev, 0x8, 0x3 << 14, 0x3 << 14);
449 /* step 4.2 de-asserts calibration reset */
450 set_nbmisc_enable_bits(nb_dev, 0x8, 1 << 14, 0 << 14);
452 /* step 4.3 wait for at least 200us */
455 /* step 4.4 de-asserts global reset */
456 set_nbmisc_enable_bits(nb_dev, 0x8, 1 << 15, 0 << 15);
458 /* step 4.5 asserts both calibration reset and global reset */
459 /* a weird step in RPR, don't do that */
460 /* set_nbmisc_enable_bits(nb_dev, 0x8, 0x3 << 14, 0x3 << 14); */
462 /* step 4.6 bring external GFX device out of reset, wait for 1ms */
464 printk(BIOS_INFO, "rs690_gfx_init step4.\n");
466 /* step 5 program PCIE memory mapped configuration space */
467 /* done by enable_pci_bar3() before */
469 /* step 6 SBIOS compile flags */
471 /* step 6.2.2 Clock-Muxing Control */
473 set_nbmisc_enable_bits(nb_dev, 0x7, 1 << 16, 1 << 16);
476 set_nbmisc_enable_bits(nb_dev, 0x7, 1 << 8, 1 << 8);
477 set_nbmisc_enable_bits(nb_dev, 0x7, 1 << 10, 1 << 10);
480 set_nbmisc_enable_bits(nb_dev, 0x7, 1 << 26, 1 << 26);
482 /* step 6.2.3 Lane-Muxing Control */
484 set_nbmisc_enable_bits(nb_dev, 0x37, 0x3 << 8, 0x2 << 8);
486 /* step 6.2.4 Received Data Control */
488 set_pcie_enable_bits(nb_dev, 0x40, 0x3 << 16, 0x2 << 16);
491 set_pcie_enable_bits(nb_dev, 0x40, 0x3 << 18, 0x3 << 18);
494 set_pcie_enable_bits(nb_dev, 0x40, 0x3 << 20, 0x0 << 20);
497 set_pcie_enable_bits(nb_dev, 0x40, 0x3 << 22, 0x1 << 22);
499 /* step 6.2.5 PLL Power Down Control */
501 set_nbmisc_enable_bits(nb_dev, 0x35, 0x3 << 6, 0x0 << 6);
503 /* step 6.2.6 Driving Strength Control */
505 set_nbmisc_enable_bits(nb_dev, 0x34, 0x1 << 24, 0x0 << 24);
508 set_nbmisc_enable_bits(nb_dev, 0x35, 0x3 << 2, 0x3 << 2);
511 printk(BIOS_INFO, "rs690_gfx_init step6.\n");
513 /* step 7 compliance state, (only need if CMOS option is enabled) */
514 /* the compliance stete is just for test. refer to 4.2.5.2 of PCIe specification */
515 if (cfg->gfx_compliance) {
516 /* force compliance */
517 set_nbmisc_enable_bits(nb_dev, 0x32, 1 << 6, 1 << 6);
518 /* release hold training for device 2. GFX initialization is done. */
519 set_nbmisc_enable_bits(nb_dev, 0x8, 1 << 4, 0 << 4);
520 dynamic_link_width_control(nb_dev, dev, cfg->gfx_link_width);
521 printk(BIOS_INFO, "rs690_gfx_init step7.\n");
525 /* step 8 common initialization */
526 /* step 8.1 sets RCB timeout to be 25ms */
527 set_pcie_enable_bits(dev, 0x70, 7 << 16, 3 << 16);
528 printk(BIOS_INFO, "rs690_gfx_init step8.1.\n");
530 /* step 8.2 disables slave ordering logic */
531 set_pcie_enable_bits(nb_dev, 0x20, 1 << 8, 1 << 8);
532 printk(BIOS_INFO, "rs690_gfx_init step8.2.\n");
534 /* step 8.3 sets DMA payload size to 64 bytes */
535 set_pcie_enable_bits(nb_dev, 0x10, 7 << 10, 4 << 10);
536 printk(BIOS_INFO, "rs690_gfx_init step8.3.\n");
538 /* step 8.4 if the LTSSM could not see all 8 TS1 during Polling Active, it can still
539 * time out and go back to Detect Idle.*/
540 set_pcie_enable_bits(dev, 0x02, 1 << 14, 1 << 14);
541 printk(BIOS_INFO, "rs690_gfx_init step8.4.\n");
543 /* step 8.5 shortens the enumeration timer */
544 set_pcie_enable_bits(dev, 0x70, 1 << 19, 1 << 19);
545 printk(BIOS_INFO, "rs690_gfx_init step8.5.\n");
547 /* step 8.6 blocks DMA traffic during C3 state */
548 set_pcie_enable_bits(dev, 0x10, 1 << 0, 0 << 0);
549 printk(BIOS_INFO, "rs690_gfx_init step8.6.\n");
551 /* step 8.7 Do not gate the electrical idle form the PHY
552 * step 8.8 Enables the escape from L1L23 */
553 set_pcie_enable_bits(dev, 0xa0, 3 << 30, 3 << 30);
554 printk(BIOS_INFO, "rs690_gfx_init step8.8.\n");
556 /* step 8.9 Setting this register to 0x1 will workaround a PCI Compliance failure reported by Vista DTM.
557 * SLOT_IMPLEMENTED@PCIE_CAP */
558 reg16 = pci_read_config16(dev, 0x5a);
560 pci_write_config16(dev, 0x5a, reg16);
561 printk(BIOS_INFO, "rs690_gfx_init step8.9.\n");
563 /* step 8.10 Setting this register to 0x1 will hide the Advanced Error Rporting Capabilities in the PCIE Brider.
564 * This will workaround several failures reported by the PCI Compliance test under Vista DTM. */
565 set_nbmisc_enable_bits(nb_dev, 0x33, 1 << 31, 0 << 31);
566 printk(BIOS_INFO, "rs690_gfx_init step8.10.\n");
568 /* step 8.11 Sets REGS_DLP_IGNORE_IN_L1_EN to ignore DLLPs during L1 so that txclk can be turned off. */
569 set_pcie_enable_bits(nb_dev, 0x02, 1 << 0, 1 << 0);
570 printk(BIOS_INFO, "rs690_gfx_init step8.11.\n");
572 /* step 8.12 Sets REGS_LC_DONT_GO_TO_L0S_IF_L1_ARMED to prevent lc to go to from L0 to Rcv_L0s if L1 is armed. */
573 set_pcie_enable_bits(nb_dev, 0x02, 1 << 6, 1 << 6);
574 printk(BIOS_INFO, "rs690_gfx_init step8.12.\n");
576 /* step 8.13 Sets CMGOOD_OVERRIDE. */
577 set_nbmisc_enable_bits(nb_dev, 0x6a, 1 << 17, 1 << 17);
578 printk(BIOS_INFO, "rs690_gfx_init step8.13.\n");
580 /* step 9 Enable TLP Flushing, for non-AMD GFX devices and Hot-Plug devices only. */
583 /* step 10 Optional Features, only needed if CMOS option is enabled. */
585 /* enabling L0s in the RS690 GFX port(s) */
586 set_pcie_enable_bits(nb_dev, 0xF9, 3 << 13, 2 << 13);
587 set_pcie_enable_bits(dev, 0xA0, 0xf << 8, 8 << 8);
588 reg16 = pci_read_config16(dev, 0x68);
590 /* L0s is intended as a power saving state */
591 /* pci_write_config16(dev, 0x68, reg16); */
593 /* enabling L0s in the External GFX Device(s) */
595 /* step 10.b: active state power management (ASPM L1) */
598 /* step 10.c: turning off PLL During L1/L23 */
599 set_pcie_enable_bits(nb_dev, 0x40, 1 << 3, 1 << 3);
600 set_pcie_enable_bits(nb_dev, 0x40, 1 << 9, 1 << 9);
602 /* step 10.d: TXCLK clock gating */
603 set_nbmisc_enable_bits(nb_dev, 0x7, 3, 3);
604 set_nbmisc_enable_bits(nb_dev, 0x7, 1 << 22, 1 << 22);
605 set_pcie_enable_bits(nb_dev, 0x11, 0xf << 4, 0xc << 4);
607 /* step 10.e: LCLK clock gating, done in rs690_config_misc_clk() */
609 /* step 11 Poll GPIO to determine whether it is single-port or dual-port configuration.
610 * While details will be added later in the document, for now assue the single-port configuration. */
613 /* Single-port/Dual-port configureation. */
614 switch (cfg->gfx_dual_slot) {
616 single_port_configuration(nb_dev, dev);
619 dual_port_configuration(nb_dev, dev);
622 printk(BIOS_INFO, "Incorrect configuration of external gfx slot.\n");